[R] Initializing lists with n objects

From: Sam Field <fieldsh_at_mail.med.upenn.edu>
Date: Fri, 11 May 2007 11:43:08 -0400

Hopefully quick question. I would like to populate a list with n objects using a for loop, so within the loop (i to n) I need to refer to a list as example.list[[i]] . This requires that I create a example.list[[i]] with n objects before the for loop. How do I do this? With matrices it is easy (matrix()).



R-help_at_stat.math.ethz.ch 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 Fri 11 May 2007 - 15:50:01 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 Fri 11 May 2007 - 17:31:45 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.