[R] List of lists? Data frames? (Or other data structures?)

R A F raf1729 at hotmail.com
Thu May 1 14:57:56 CEST 2003


For what it's worth, I followed the suggestion of using colClasses:

cls <- c( "numeric", "character", "numeric", "numeric", "numeric" )
system.time( bbb <- read.table( "file", colClasses = cls ) )

Here're the results from three tries:
8.21 0.06 8.28 0.00 0.00
8.94 0.10 9.10 0.00 0.00
8.55 0.06 8.69 0.00 0.00

I also did
system.time( aaa <- scan( "file", list( 0, "", 0, 0, 0 ) ) three
times:

6.46 0.04 6.59 0.00 0.00
5.27 0.04 5.33 0.00 0.00
5.14 0.05 5.19 0.00 0.00

By the way, I did the experiment in the order bbb, aaa, bbb, aaa,
bbb, aaa.

So it appears that read.table is still a little slower -- but it could
be just me doing something wrong.

Thanks.

>From: "R A F" <raf1729 at hotmail.com>
>To: p.dalgaard at biostat.ku.dk
>CC: r-help at stat.math.ethz.ch, rpeng at stat.ucla.edu, ripley at stats.ox.ac.uk
>Subject: Re: [R] List of lists? Data frames? (Or other data structures?)
>Date: Thu, 01 May 2003 12:20:57 +0000
>
>Ah, thanks!
>
>(It's not that I didn't reading it -- I didn't understand it and so
>I thought that it'd be easier to ask again.  Thanks very much!)
>
>>From: Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk>
>>To: "R A F" <raf1729 at hotmail.com>
>>CC: ripley at stats.ox.ac.uk, rpeng at stat.ucla.edu, r-help at stat.math.ethz.ch
>>Subject: Re: [R] List of lists? Data frames? (Or other data structures?)
>>Date: 01 May 2003 14:19:32 +0200
>>
>>You're not taking Brian's hint!:



More information about the R-help mailing list