[R] How to extract sublist from a list?

richard.ma xuanlong.ma at uts.edu.au
Thu Aug 4 03:38:30 CEST 2011


Hi everyone,

Suppose I have a list named "lst", see below:

> lst
$sub1
...
$sub1$x
...
$sub1$y
....

$sub2
...
$sub2$x
...
$sub2$y
…
$sub3
...
...
...

Now, I want to extract the sub-sublist $y from every sublist(sub1, sub2...)
and then storage them to a new list.

I know how to extract them by subscript or list name one by one, but I
wonder if there exist some tricks to finish this job more automatically. 

Best regards,
Richard @Sydney


--
View this message in context: http://r.789695.n4.nabble.com/How-to-extract-sublist-from-a-list-tp3717451p3717451.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list