s-news
[Top] [All Lists]

Re: list inside a loop

To: "Dayan,Y (pgt)" <Y.Dayan@lse.ac.uk>
Subject: Re: list inside a loop
From: Spencer Graves <spencer.graves@PDF.COM>
Date: Mon, 18 Aug 2003 11:43:34 -0700
Cc: s-news@wubios.wustl.edu
References: <3100D3EB2A0EBE42957CC8E85F68737601F335DE@exs1.backup>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
The function "stepAIC" in the MASS library initializes a list as follows:

        models <- vector("list", steps)

where "steps" is the maximum number of steps in the loop. Then the for iteration "i" in the loop, they have

        models[[i]] <- ...

The MASS library, you may know, accompanies the book Modern Applied Statistics with S by Venables and Ripley (2002; Springer). These two authors seem to know as much about S as anyone.

hope this helps.  spencer graves

Dayan,Y (pgt) wrote:
Hello,

I am conducting a simulation study, and am trying to gradually add components to a 'list' data frame (i.e. inside a loop), ending up with a list of 1000 components (means, standard errors, etc..).

Can anyone suggest a non manual way of adding components to a list data frame?

Yehuda



<Prev in Thread] Current Thread [Next in Thread>