[R] determination of number of entries in list elements

Benjamin Otto b.otto at uke.uni-hamburg.de
Fri May 19 12:09:43 CEST 2006


Hi,

is there some elegant way to determine the number of components stored in
each list element?

Example:

The list:
---------
> list

$Elem1
[1] A B C

$Elem1
[1] D

$Elem1
[1] E F

Then normal command "length(list)" would return 3. But I would like some
command return the array of the single element lengths like

[1] 3 1 2

so I can afterwards get my list subset with only entries which have a
certain amount of components bigger or lower than a certain threshold.

regards

Benjamin




More information about the R-help mailing list