user1415530
user1415530

Reputation: 413

converting a list of lists in a single list

A = data.frame( a = c(1:10), b = c(11:20) )
B = data.frame( a = c(101:110), b = c(111:120) )
C = data.frame( a = c(5:8), b = c(55:58) )

L = list(list(B,C),list(A),list(C,A),list(A,B,C),list(C))

I have a list of lists of Data Frames, L but I have to creat a single List of all the Data Frames as below (The ordering of the dataframes should remain same in L and New L.)

NewL = list( B,C,A,C,A,A,B,C,C )

Upvotes: 16

Views: 5598

Answers (1)

shhhhimhuntingrabbits
shhhhimhuntingrabbits

Reputation: 7475

Try reading the manual ;) and

unlist(L,recursive=F)

Upvotes: 14

Related Questions