[R] How can I index multiple linear models? (Without getting a warning.)
Dieter Menne
dieter.menne at menne-biomed.de
Tue Feb 1 08:19:34 CET 2011
BSanders wrote:
>
>
> .....
> lin[i] = lm(reservesub[,3]~ reservesub[,i+3])
>
> For which I'm given 15 warning messages which say :
>
> "1: In lin[i] = lm(reservesub[, 3] ~ reservesub[, i + 3]) :
> number of items to replace is not a multiple of replacement length"
>
lin = list()
for(i in 1:15){
b = rnorm(10)
q = rnorm(10)
#lin[i] = lm(b~q) #warnings
lin[[i]] = lm(b~q) #warnings
}
Dieter
--
View this message in context: http://r.789695.n4.nabble.com/How-can-I-index-multiple-linear-models-Without-getting-a-warning-tp3250535p3250594.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list