Re: [R] Very slow assignments

2011-09-07 Thread André Rossi
eatedly expanding it. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of André Rossi > > Sent: Wednesday, September 07, 2011 3:08 PM >

Re: [R] Very slow assignments

2011-09-07 Thread Rolf Turner
On 08/09/11 12:05, William Dunlap wrote: You did not show the code you used to populate your object, but consider the following ways to make as.list(1:5) via repeated assignments: > system.time( { z0<- list() ; for(i in 1:5)z0[i]<- list(i) } ) user system elapsed 13.340.

Re: [R] Very slow assignments

2011-09-07 Thread William Dunlap
it. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of André Rossi > Sent: Wednesday, September 07, 2011 3:08 PM > To: r-help@r-project.org > Subject: [R]

[R] Very slow assignments

2011-09-07 Thread André Rossi
I'm creating an object of a S4 class that has two slots: ListExamples, which is a list, and idx, which is an integer (as the code below). Then, I read a data.frame file with 1 (ten thousands) of lines and 10 columns, do some pre-processing and, basically, I store each line as an element of a l