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
@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-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