[R] for loop in assigning column names

2007-03-21 Thread Luis Ridao Cruz
R-help, I have a data frame (df) and I want to add some columns whose names should correspond to the i index in the loop below. for(i in 1:10) { df$eval(paste(St, as.character(i), sep = )) - ObJeCt[i] } An error message comes out : Error: attempt to apply non-function How can I get

Re: [R] for loop in assigning column names

2007-03-21 Thread ONKELINX, Thierry
Onderwerp: [R] for loop in assigning column names R-help, I have a data frame (df) and I want to add some columns whose names should correspond to the i index in the loop below. for(i in 1:10) { df$eval(paste(St, as.character(i), sep = )) - ObJeCt[i] } An error message comes out

Re: [R] for loop in assigning column names

2007-03-21 Thread Dimitris Rizopoulos
in assigning column names R-help, I have a data frame (df) and I want to add some columns whose names should correspond to the i index in the loop below. for(i in 1:10) { df$eval(paste(St, as.character(i), sep = )) - ObJeCt[i] } An error message comes out : Error: attempt to apply non