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