search for: n_var

Displaying 1 result from an estimated 1 matches for "n_var".

Did you mean: _var
2017 Oct 13
1
Quotation marks hinder for loop
...;- merge(ms,V37) Since these codes take a lot of space in my R console and I am also afraid of making any mistakes while typing the codes, I would like to make this code simple by using for loop. I know that the assign function is useful and another code as follows worked well with it: for(i in 1:N_var){ assign(paste("V", i, sep=""), post_df[Nrange$start[i]:Nrange$end[i],]) } However, I could not find how to apply for loop to 1) - 3) above. 1) >for (i in 1:N_var){ + assign(colnames(paste("V", i, sep=""))[2], par$V2[i]) + } Error in assign(colnames(...