[R] Quick q. on lists

Jonathan jonsleepy at gmail.com
Thu Aug 19 17:42:24 CEST 2010


Hi All,
    Anyone know how to quickly query some summary information on the
components of a list?

For example, I have a list that contains dataframes (originally
generated by using split() on one large data frame).


I simply want to know the number of rows in the longest dataframe from the list.

Example, if my list has 3 data frames, and the first has 2 rows, the
second 8 rows, and the third 3 rows, I want to ask something like:


max(nrow(myList))
which would ideally return "8".


but this is obviously wrong syntax.

Currently, I'm looping through each of the data frames in the list,
searching for the max rows, but I'm sure there must be a faster way.

Thanks,
Jonatahn



More information about the R-help mailing list