[R] A list within a list?

Greg Snow Greg.Snow at imail.org
Sun Feb 6 03:51:15 CET 2011


How are your lists being created?

You can add each list to a mega list in a for loop, or use lapply to run a function multiple times which outputs a list each time and these will automatically be put together into a mega list.

If these don't work for you then tell us more about how you are creating the inner lists (sample code helps).

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Jim Silverton
> Sent: Saturday, February 05, 2011 7:39 PM
> To: r-help at r-project.org
> Subject: Re: [R] A list within a list?
> 
> Hello,
> I am planning of building a list of lists specifically,  my first list
> is
> some what of the sort:
> lidta <- list(m, p, r, s, q, A, B)
> where A and B are matrices that may be of different number of rows .
> The
> number of rows in matrix A and matrix B depends on the the values of m.
> 
> The question is I don;t know how to put all the 1000 or so of these
> lists
> into a 'mega' list.
> 
> Can you help me?
> 
> 
> 
> 
> --
> Thanks,
> Jim.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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.



More information about the R-help mailing list