Skip to content

Filling Lists or Arrays of variable dimensions

1 message · Tim Howard

#
Jessica,
In terms of initializing your list for populating it in a later step, I think this partially gets at your question -- it removes the upper loop assignment, but then does require a loop to get the second level. Perhaps there's something here you can work with ...
 
 
height<-c("high","low")
width<-c("slim","wide")
 
l <- vector("list",length(height))       
names(l) <- height
 
for(i in 1:length(l)){
l[[i]] <- vector("list",length(width))
names(l[[i]]) <- width
}
 
 
Best
Tim
 
Date: Fri, 21 Dec 2012 11:34:06 +0100
From: Jessica Streicher <j.streicher at micromata.de>
To: David Winsemius <dwinsemius at comcast.net>
Cc: R help <r-help at r-project.org>
Subject: Re: [R] Filling Lists or Arrays of variable dimensions
Message-ID: <BE0EF9BE-A571-45F3-92E6-72E093BB50CA at micromata.de>
Content-Type: text/plain; charset=us-ascii

@David : In my mind it was quite complete enough.

@William: Thanks, didn't know you could do that with data frames, if i ever have to do something similar again i might try this.
On 20.12.2012, at 22:39, David Winsemius wrote:

            
------------------------------

Message: 58
Date: Fri, 21 Dec 2012 19:46:17 +0900
From: Pascal Oettli <kridox at ymail.com>
To: saumya Joshi <saumyaj2008 at yahoo.com>
Cc: r-help at r-project.org
Subject: Re: [R] How to run chaid in R
Message-ID: <50D43DF9.6090102 at ymail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

https://stat.ethz.ch/pipermail/r-help/2009-August/209752.html


Le 21/12/2012 18:07, saumya Joshi a ?crit :
------------------------------

_______________________________________________
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.

End of R-help Digest, Vol 118, Issue 21
***************************************