-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello:
I'm having problems with this line of code:
X.lm - lapply(names(d), function(x) lm(d[cls] ~ d[x], data=d))
d[x] is what is giving trouble here, but I don't know exactly how to
solve it. What I'm trying to do is to create a
PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Friday, December 16, 2005 9:33 AM
Subject: [R] Help with data.frame and lapply
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello:
I'm having problems with this line of code:
X.lm - lapply(names(d), function(x) lm(d[cls] ~ d[x], data=d))
d[x
Hello:
I'm having problems with this line of code:
X.lm - lapply(names(d), function(x) lm(d[cls] ~ d[x], data=d))
d[x] is what is giving trouble here, but I don't know
exactly how to solve it.
How does d look like?
Probably d[,cls] and d[,x] instead of d[cls] and d[x]
d - data.frame(x1 = rnorm(100), x2 = rnorm(100), x3 = rnorm(100), cls =
rnorm(100))
dd - subset(d, sel=-cls)
lapply(paste(lm(cls ~, names(dd), ,data=d)), function(x)
eval(parse(text=x)))
Juan Daniel López Serna a écrit :
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello:
I'm having