[R] Exceptional slowness with read.csv

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Mon Apr 8 21:14:52 CEST 2024


Às 19:42 de 08/04/2024, Ivan Krylov via R-help escreveu:
> В Sun, 7 Apr 2024 23:47:52 -0600
> Dave Dixon <ddixon using swcp.com> пишет:
> 
>>   > second_records <- read.csv(file_name, skip = 2459465, nrows = 5)
> 
> It may or may not be important that read.csv defaults to header =
> TRUE. Having skipped 2459465 lines, it may attempt to parse the next
> one as a header, so the second call read.csv() should probably include
> header = FALSE.


This will throw an error, call read.table with sep="," instead.


> 
> Bert's advice to try scan() is on point, though. It's likely that the
> default-enabled header is not the most serious problem here.
> 

Hoep this helps,

Rui Barradas


-- 
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença de vírus.
www.avg.com



More information about the R-help mailing list