jamaas wrote:
>
> Long story short, I have a big iterative procedure that produces a long
> list of data.frames such as the one called
> "results" here. Is there an easy way to produce a similar list of
> data.frames comprised of the mean of each of the
> columns in results, such that it ends up
Hi Jim,
Using ?lapply with ?colMeans should do the trick. Here is a little sample:
eg <- list(mtcars, mtcars) # mtcars data frame twice in a list
resultsmean <- lapply(eg, colMeans) # calculate column means for each
element of "eg"
resultsmean # show the results
Hope this helps,
Josh
On Sun,
2 matches
Mail list logo