Re: [R] for loop in assigning column names

2007-03-21 Thread Dimitris Rizopoulos
er 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: "Luis Ridao Cruz" <[EMAIL PROTECTED]> To: Sent: Wednesday, March 21, 2007 4:14 PM

Re: [R] for loop in assigning column names

2007-03-21 Thread ONKELINX, Thierry
@stat.math.ethz.ch > 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(&

[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