Re: [R] Initializing lists with n objects (never mind)

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

sorry every one. I figured it out. I didn't realize that you could add objects so easily. I just went with

example.list <- list(1)

Sam

Sam Field wrote:
> 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()).
>
> thanks!
>
> Sam
>
> ______________________________________________
> 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.
>
>
>



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 - 16:10:48 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 - 16:31:14 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.