Skip to content
Prev 295136 / 398506 Next

for loop, error in model frame.default ... variable lengths differ

Hi

You did not provide data but I can see some problems in your code. See 
inline.
and I
names,
throughout
So i is actually values from 1 to length of vars variable.
and you select variables from df[,1] to df[, length(vars)], which is 
probably not what you want.
What is x1-x3? are they variables in df?
for mean the correct statement is na.rm=TRUE
Maybe x1 has different length as df. What length(x1) and dim(df) tells 
you?

Regards
Petr
get
http://www.R-project.org/posting-guide.html