[datatable-help] Odd problem using fread to read in a csv file: no data, just headers
Kevin Ushey
kevinushey at gmail.com
Thu Mar 6 04:55:57 CET 2014
Works fine for me with data.table 1.9.1 on OS X. What is your sessionInfo()?
Kevin
On Wed, Mar 5, 2014 at 7:53 PM, Farrel Buchinsky <fjbuch at gmail.com> wrote:
> Any idea why I am getting a data.table with headers only and zero data? How
> can I get around the problem.
>
> fread("http://www.cdc.gov/growthcharts/data/zscore/statage.csv", verbose=T)
> fails
> read.csv("http://www.cdc.gov/growthcharts/data/zscore/statage.csv") succeeds
>
>> statagecdc <-
>> fread("http://www.cdc.gov/growthcharts/data/zscore/statage.csv", verbose=T)
> trying URL 'http://www.cdc.gov/growthcharts/data/zscore/statage.csv'
> Content type 'application/octet-stream' length 66087 bytes (64 Kb)
> opened URL
> downloaded 64 Kb
>
> Input contains no \n. Taking this to be a filename to open
> File opened, filesize is 6.2E-05B
> File is opened and mapped ok
> Detected eol as \r only (no \n afterwards). An old Mac 9 standard,
> discontinued in 2002 according to Wikipedia.
> Using line 1 to detect sep (the last non blank line in the first
> 'autostart') ... sep=','
> Found 14 columns
> First row with 14 fields occurs on line 1 (either column names or first row
> of data)
> All the fields on line 1 are character fields. Treating as the column names.
> Byte after header row is eof or eol, 0 data rows present.
> Type codes: 00000000000000 (first 5 rows)
> Type codes: 00000000000000 (after applying colClasses and integer64)
> Type codes: 00000000000000 (after applying drop or select (if supplied)
> Allocating 14 column slots (14 - 0 NULL)
> 0.000s ( 0%) Memory map (rerun may be quicker)
> 0.000s ( 0%) sep and header detection
> 0.001s (100%) Count rows (wc -l)
> 0.000s ( 0%) Column type detection (first, middle and last 5 rows)
> 0.000s ( 0%) Allocation of 0x14 result (xMB) in RAM
> 0.000s ( 0%) Reading data
> 0.000s ( 0%) Allocation for type bumps (if any), including gc time if
> triggered
> 0.000s ( 0%) Coercing data already read in type bumps (if any)
> 0.000s ( 0%) Changing na.strings to NA
> 0.001s Total
>
>
> Thanks a lot.
>
> Farrel Buchinsky
> Google Voice Tel: (412) 567-7870
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
More information about the datatable-help
mailing list