Not to hijack the thread, but for my edification, what are the
advantages/disadvantages of split() + lapply() compared to by()?
Josh
On Sun, Jul 18, 2010 at 9:50 PM, Dennis Murphy wrote:
> Hi:
>
> Time to jack up your level of R knowledge, courtesy of the apply family.
>
> The 'R way' to do what
Hi:
Time to jack up your level of R knowledge, courtesy of the apply family.
The 'R way' to do what you want is to split the data by species into list
components, run lm() on each component and save the resulting lm objects in
a list. The next trick is to figure out how to extract what you want,
Hello,
Take a look at ?by
Something like:
by(data, data[ , "species id"], function(x) {lm(o2con ~ bm, data = x)})
As an aside, it can be a bit cumbersome to deal with spaces in a
variables name (because it has to be quoted then). Also since data is
a function, something like mydata might make
Hi All,
I have a large data set with many columns of data. One of these columns is a
species identifier and the remainder are variables such as temperature or
mass. Currently I am carrying out a single regression on subsets of the data
set, e.g. separated data sets with only the data from one spe
4 matches
Mail list logo