[R] Dimensions of a List

From: Shubha Vishwanath Karanth <shubhak_at_ambaresearch.com>
Date: Tue, 25 Mar 2008 20:57:18 +0530


Hi R,  

I have a list,  

l=list(list(c(1,2),c(4,5),c(6,7)),list(c(11,22,33),c(44,55,66)))  

> l

[[1]]

[[1]][[1]]

[1] 1 2
 

[[1]][[2]]

[1] 4 5
 

[[1]][[3]]

[1] 6 7
   

[[2]]

[[2]][[1]]

[1] 11 22 33
 

[[2]][[2]]

[1] 44 55 66
   

How do I know the dimensions of this list?... In other words, how many sub-lists, sub-sub-lists etc...are there in l? How do I know this?  

Thanks in advance

Shubha

This e-mail may contain confidential and/or privileged i...{{dropped:13}}



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 25 Mar 2008 - 17:12:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 25 Mar 2008 - 18:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive