[R] Retrieving data from nested lists

blue honour bluehonour at yahoo.com
Wed May 27 00:59:34 CEST 2015


Dear R users,
I have a question regarding retrieving data from nested lists. To illustrate, here is an example input:
d1<-data.table(v1=c(3,4),v2=c(2,5))
d2<-data.table(v1=c(1,2),v2=c(1,1))l1<-list(d1,name="test")l2<-list(d2,name="test2")motherlist<-list()motherlist$l1<-l1motherlist$l2<-l2
Let's say we are given motherlist as above. We would like to get the union of the contents of v1 vector from d1 data.table and the v1 vector from d2 data.table. How can we achieve this in a compact one line command using motherlist as input please? 
Thank you. 



	[[alternative HTML version deleted]]



More information about the R-help mailing list