[R] Exceptional slowness with read.csv

Dave Dixon dd|xon @end|ng |rom @wcp@com
Mon Apr 8 22:25:07 CEST 2024


Right, I meant to add header=FALSE. And, it looks now like the next line 
is the one with the unclosed quote, so read.csv is trying to read 
million-character headers!

On 4/8/24 12:42, Ivan Krylov wrote:
> В 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.
>
> 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.
>



More information about the R-help mailing list