I get a list object from an iterative function. I'm trying to figure out the most efficient way to calculate the mean of one element, across all components of the overall list.

I've tried

output <- mean (listobject[[1:5]]$element)

to get the mean of "element" in the first five components?

It doesn't like the $. I'm suspect one of the "apply" functions will work, but again I've not had success


Thanks a bunch.

J

----
Jim Maas
University of East Anglia

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to