Answers for "r define nested empty list"

R
3

r define nested empty list

my.list<-lapply(my.list<-vector(mode = 'list',5),function(x) # 1st level with 5 objects
      x<-lapply(x<-vector(mode = 'list',3),function(x)       # 2nd level with 3 nested objects
      x<-vector(mode='list',2)))                             # 3rd level with 2 nested objects
Posted by: Guest on February-11-2021

Browse Popular Code Answers by Language