[R] Two Noobie questions

AllenL allen.larocque at gmail.com
Tue Jan 6 19:50:06 CET 2009


1. I have a list of lm (linear model) objects. Is it possible to select,
through subscripts, a particular element (say, the intercept) from all the
models? I've tried something like this:

List[[1:length(list)]][1]
All members of the list are similar. My goal is to have a list of the
intercepts and lists of other estimated parameters. Is it better to convert
to a matrix? How to do this?

2. Connected to this, how do I convert from a list back to a vector? This
problem arose from using "split" to split a vector by a factor, then
selecting a subset of this (ie. length>10), leaving me with subset list of
my original. Unsplit(newList, factor) doesn't work, presumably due to my
removal of some values. Thoughts?

Thanks!
-Allen



-- 
View this message in context: http://www.nabble.com/Two-Noobie-questions-tp21316554p21316554.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list