[R] efficient equivalent to read.csv / write.csv

Henrik Bengtsson hb at stat.berkeley.edu
Tue Sep 28 20:56:54 CEST 2010


To speed things up, you certainly want to give R more clues about your
data files by being more explicit by many of the arguments (cf.
help(read.table), especially specifying argument 'colClasses' makes a
big difference.

/Henrik

On Tue, Sep 28, 2010 at 10:24 AM, statquant2 <statquant at gmail.com> wrote:
>
> Hi, after testing
> R) system.time(read.csv("myfile.csv"))
>   user  system elapsed
>  1.126   0.038   1.177
>
> R) system.time(read.csv.sql("myfile.csv"))
>   user  system elapsed
>  1.405   0.025   1.439
> Warning messages:
> 1: closing unused connection 4 ()
> 2: closing unused connection 3 ()
>
> It seems that the function is less efficient that the base one ... so ...
> --
> View this message in context: http://r.789695.n4.nabble.com/efficient-equivalent-to-read-csv-write-csv-tp2714325p2717585.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list