Hi all, how can I effectively add new objects to a list of which the eventual length is unknown? I have been using something like mylist[[length(mylist)+1]] = newobject but I wonder if there is something better. this question might look familiar. It is the same question as has been asked here: http://tolstoy.newcastle.edu.au/R/help/05/02/12152.html Unfortunately, the link containing the answer is broken. Any tips? Bram
Perhaps it was this: https://stat.ethz.ch/pipermail/r-help/2005-January/063530.html On Thu, Jun 18, 2009 at 6:09 PM, bram<a.l.w.kuijper at rug.nl> wrote:> Hi all, > > how can I effectively add new objects to a list of which the eventual length > is unknown? > > I have been using something like > > mylist[[length(mylist)+1]] = newobject > > but I wonder if there is something better. > > this question might look familiar. It is the same question as has been asked > here: > http://tolstoy.newcastle.edu.au/R/help/05/02/12152.html > > Unfortunately, the link containing the answer is broken. > > Any tips? > > Bram > > ______________________________________________ > 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. >
On Jun 18, 2009, at 6:09 PM, bram wrote:> Hi all, > > how can I effectively add new objects to a list of which the > eventual length is unknown? > > I have been using something like > > mylist[[length(mylist)+1]] = newobject > > but I wonder if there is something better. > > this question might look familiar. It is the same question as has > been asked here: > http://tolstoy.newcastle.edu.au/R/help/05/02/12152.html > > Unfortunately, the link containing the answer is broken.That is a five year old link, but were you reading the list yesterday? The question was asked and answered.> > Any tips? >Read R-help?> Bram > > ______________________________________________ > 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.David Winsemius, MD Heritage Laboratories West Hartford, CT