The usual method is either

lis <- vector("list")

or, nearly equivalently,

lis <- list()

If you know in advance how many components the list will have, there can be a 
slight advantage in using 

lis25 <- vector("list", 25)

if e.g. you know the list will be of length 25.

Bill Venables.

 

-----Original Message-----
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of song song
Sent: Tuesday, 22 June 2010 9:18 AM
To: r-help@r-project.org
Subject: [R] how to initial a list to store data result?

May I ask how to initialize a list?

usually I will use " result=list(0) "  to do this. is this right?

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

______________________________________________
R-help@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.

Reply via email to