[R] Help with data.frame and lapply

From: Juan Daniel López Serna <juanda.lopez_at_iic.uam.es>
Date: Fri 16 Dec 2005 - 19:33:22 EST


-----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 linear model from each column of the data frame 'd' to apply ANOVA later.

        Thanks very much in advance. Regards:

Juan Daniel López Serna

iD8DBQFDonvRXHsVbn2qIYMRAqi8AJ0X6zOAevAGzMczQ+ahHlVJnUK4ZQCeIDi6 PPB3baK8JNOa3eoIgbmVCdM=
=WKlt
-----END PGP SIGNATURE-----



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Dec 16 19:51:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:39 EST