<div dir="ltr"><div>I quickly read the last mail, Is this the test you needed guys?</div><div><br></div><div>> fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv">http://www.cdc.gov/growthcharts/data/zscore/statage.csv</a>", verbose=FALSE)</div>
<div>trying URL '<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv">http://www.cdc.gov/growthcharts/data/zscore/statage.csv</a>'</div><div>Content type 'application/octet-stream' length 66087 bytes (64 Kb)</div>
<div>opened URL</div><div>downloaded 64 Kb</div><div><br></div><div>Empty data.table (0 rows) of 14 cols: Sex,Agemos,L,M,S,P3...</div><div>> sessionInfo()</div><div>R version 3.0.2 (2013-09-25)</div><div>Platform: x86_64-w64-mingw32/x64 (64-bit)</div>
<div><br></div><div>locale:</div><div>[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 </div><div>[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C </div>
<div>[5] LC_TIME=English_United Kingdom.1252 </div><div><br></div><div>attached base packages:</div><div>[1] stats graphics grDevices utils datasets methods base </div><div><br></div><div>other attached packages:</div>
<div>[1] data.table_1.9.3</div><div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] plyr_1.8.1 Rcpp_0.11.0 reshape2_1.2.2 Rook_1.0-9 stringr_0.6.2 tools_3.0.2 </div><div>> fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv">http://www.cdc.gov/growthcharts/data/zscore/statage.csv</a>", verbose=FALSE)</div>
<div>trying URL '<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv">http://www.cdc.gov/growthcharts/data/zscore/statage.csv</a>'</div><div>Content type 'application/octet-stream' length 66087 bytes (64 Kb)</div>
<div>opened URL</div><div>downloaded 64 Kb</div><div><br></div><div>Empty data.table (0 rows) of 14 cols: Sex,Agemos,L,M,S,P3...</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 March 2014 12:34, Matt Dowle <span dir="ltr"><<a href="mailto:mdowle@mdowle.plus.com" target="_blank">mdowle@mdowle.plus.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Works for me as well on linux, same output as Kevin's.<br>
<br>
I was perplexed as to why Farrel's output has :<div class=""><br>
File opened, filesize is 6.2E-05B<br></div>
but we see :<div class=""><br>
File opened, filesize is 0.000 GB<br></div>
That line is switched depending on Windows or not. Comparing them :<br>
<br>
// On Windows :<br>
if (verbose) Rprintf("File opened, filesize is %.3 GB\n", 1.0*filesize/(1024*1024*1024))<u></u>;<br>
<br>
// On non-Windows :<br>
if (verbose) Rprintf("File opened, filesize is %.3f GB\n", 1.0*filesize/(1024*1024*1024))<u></u>;<br>
<br>
So, a missing "f". Just committed a fix for that (r1223). That line is part of a block that is necessarily different on Windows because its file and mmap commands are different. The missing 'f' could have feasibly corrupted memory somehow (strange that the "G" of "GB" got overwritten) and if so would explain why it thought it got to the end of the file before seeing the \n after the \r.<br>
<br>
Farrel - does v1.9.2 work for you on Windows with verbose=FALSE? If yes, then very likely verbose=TRUE will now work with commit 1223. Best to start with a new R session to clear any possible memory corruption and then try :<br>
<br>
fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>", verbose=FALSE)<br>
<br>
If not, can anyone else reproduce on Windows? If so, I'll need to debug it on Windows.<br>
<br>
Thanks,<br>
Matt<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 06/03/14 05:19, Kevin Ushey wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think Matt and Arun will have more information -- IIUC, fread is<br>
only now gaining support for reading from URLs on Windows.<br>
<br>
Something strange: I get different output on the file structure with<br>
fread. Posting in case it's useful:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
statagecdc <- fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>", verbose=T)<br>
</blockquote>
Input contains no \n. Taking this to be a filename to open<br>
File opened, filesize is 0.000 GB<br>
File is opened and mapped ok<br>
Detected eol as \r\n (CRLF) in that order, the Windows standard.<br>
Using line 30 to detect sep (the last non blank line in the first<br>
'autostart') ... sep=','<br>
Found 14 columns<br>
First row with 14 fields occurs on line 1 (either column names or<br>
first row of data)<br>
All the fields on line 1 are character fields. Treating as the column names.<br>
Count of eol after first data row: 437<br>
Subtracted 1 for last eol and any trailing empty lines, leaving 436 data rows<br>
Type codes: 13333333333333 (first 5 rows)<br>
Type codes: 13333333333333 (+middle 5 rows)<br>
Type codes: 13333333333333 (+last 5 rows)<br>
Type codes: 13333333333333 (after applying colClasses and integer64)<br>
Type codes: 13333333333333 (after applying drop or select (if supplied)<br>
Allocating 14 column slots (14 - 0 NULL)<br>
0.000s ( 13%) Memory map (rerun may be quicker)<br>
0.000s ( 4%) sep and header detection<br>
0.000s ( 13%) Count rows (wc -l)<br>
0.001s ( 49%) Column type detection (first, middle and last 5 rows)<br>
0.000s ( 1%) Allocation of 436x14 result (xMB) in RAM<br>
0.000s ( 19%) Reading data<br>
0.000s ( 0%) Allocation for type bumps (if any), including gc time<br>
if triggered<br>
0.000s ( 0%) Coercing data already read in type bumps (if any)<br>
0.000s ( 0%) Changing na.strings to NA<br>
0.002s Total<br>
<br>
Note that fread sees \r\n as newlines for me.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
sessionInfo()<br>
</blockquote>
R Under development (unstable) (2014-02-12 r64976)<br>
Platform: x86_64-apple-darwin13.0.0 (64-bit)<br>
<br>
locale:<br>
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.<u></u>UTF-8/C/en_CA.UTF-8/en_CA.UTF-<u></u>8<br>
<br>
attached base packages:<br>
[1] stats graphics grDevices utils datasets methods base<br>
<br>
other attached packages:<br>
[1] data.table_1.9.1 knitr_1.5.15 devtools_1.4.1.99<br>
BiocInstaller_1.13.3<br>
<br>
loaded via a namespace (and not attached):<br>
[1] compiler_3.1.0 digest_0.6.4 evaluate_0.5.1<br>
formatR_0.10 httr_0.2 memoise_0.1<br>
[7] parallel_3.1.0 plyr_1.8 Rcpp_0.11.0.3<br>
RCurl_1.95-4.1 reshape2_1.3.0.99 stringr_0.6.2<br>
[13] tools_3.1.0 whisker_0.3-2<br>
<br>
Kevin<br>
<br>
On Wed, Mar 5, 2014 at 9:04 PM, Farrel Buchinsky <<a href="mailto:fjbuch@gmail.com" target="_blank">fjbuch@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
sessionInfo()<br>
</blockquote>
R version 3.0.2 (2013-09-25)<br>
Platform: x86_64-w64-mingw32/x64 (64-bit)<br>
<br>
locale:<br>
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United<br>
States.1252 LC_MONETARY=English_United States.1252<br>
[4] LC_NUMERIC=C LC_TIME=English_United<br>
States.1252<br>
<br>
attached base packages:<br>
[1] grid stats graphics grDevices utils datasets methods<br>
base<br>
<br>
other attached packages:<br>
[1] reshape2_1.2.2 data.table_1.9.2 gridExtra_0.9.1 ggplot2_0.9.3.1<br>
RGoogleDocs_0.7-0<br>
<br>
loaded via a namespace (and not attached):<br>
[1] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.4 gtable_0.1.2<br>
labeling_0.2 MASS_7.3-29 munsell_0.4.2<br>
[8] plyr_1.8.1 proto_0.3-10 RColorBrewer_1.0-5 Rcpp_0.11.0<br>
RCurl_1.95-4.1 scales_0.2.3 stringr_0.6.2<br>
[15] tools_3.0.2 XML_3.98-1.1<br>
<br>
Farrel Buchinsky<br>
Google Voice Tel: <a href="tel:%28412%29%20567-7870" value="+14125677870" target="_blank">(412) 567-7870</a><br>
<br>
<br>
On Wed, Mar 5, 2014 at 10:55 PM, Kevin Ushey <<a href="mailto:kevinushey@gmail.com" target="_blank">kevinushey@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Works fine for me with data.table 1.9.1 on OS X. What is your<br>
sessionInfo()?<br>
<br>
Kevin<br>
<br>
On Wed, Mar 5, 2014 at 7:53 PM, Farrel Buchinsky <<a href="mailto:fjbuch@gmail.com" target="_blank">fjbuch@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any idea why I am getting a data.table with headers only and zero data?<br>
How<br>
can I get around the problem.<br>
<br>
fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>",<br>
verbose=T)<br>
fails<br>
read.csv("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>")<br>
succeeds<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
statagecdc <-<br>
fread("<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>",<br>
verbose=T)<br>
</blockquote>
trying URL '<a href="http://www.cdc.gov/growthcharts/data/zscore/statage.csv" target="_blank">http://www.cdc.gov/<u></u>growthcharts/data/zscore/<u></u>statage.csv</a>'<br>
Content type 'application/octet-stream' length 66087 bytes (64 Kb)<br>
opened URL<br>
downloaded 64 Kb<br>
<br>
Input contains no \n. Taking this to be a filename to open<br>
File opened, filesize is 6.2E-05B<br>
File is opened and mapped ok<br>
Detected eol as \r only (no \n afterwards). An old Mac 9 standard,<br>
discontinued in 2002 according to Wikipedia.<br>
Using line 1 to detect sep (the last non blank line in the first<br>
'autostart') ... sep=','<br>
Found 14 columns<br>
First row with 14 fields occurs on line 1 (either column names or first<br>
row<br>
of data)<br>
All the fields on line 1 are character fields. Treating as the column<br>
names.<br>
Byte after header row is eof or eol, 0 data rows present.<br>
Type codes: 00000000000000 (first 5 rows)<br>
Type codes: 00000000000000 (after applying colClasses and integer64)<br>
Type codes: 00000000000000 (after applying drop or select (if supplied)<br>
Allocating 14 column slots (14 - 0 NULL)<br>
0.000s ( 0%) Memory map (rerun may be quicker)<br>
0.000s ( 0%) sep and header detection<br>
0.001s (100%) Count rows (wc -l)<br>
0.000s ( 0%) Column type detection (first, middle and last 5 rows)<br>
0.000s ( 0%) Allocation of 0x14 result (xMB) in RAM<br>
0.000s ( 0%) Reading data<br>
0.000s ( 0%) Allocation for type bumps (if any), including gc time<br>
if<br>
triggered<br>
0.000s ( 0%) Coercing data already read in type bumps (if any)<br>
0.000s ( 0%) Changing na.strings to NA<br>
0.001s Total<br>
<br>
<br>
Thanks a lot.<br>
<br>
Farrel Buchinsky<br>
Google Voice Tel: <a href="tel:%28412%29%20567-7870" value="+14125677870" target="_blank">(412) 567-7870</a><br>
<br>
______________________________<u></u>_________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.<u></u>r-project.org</a><br>
<br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-<u></u>project.org/cgi-bin/mailman/<u></u>listinfo/datatable-help</a><br>
</blockquote></blockquote>
<br>
</blockquote>
______________________________<u></u>_________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.<u></u>r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-<u></u>project.org/cgi-bin/mailman/<u></u>listinfo/datatable-help</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.<u></u>r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-<u></u>project.org/cgi-bin/mailman/<u></u>listinfo/datatable-help</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><p><b><span style="font-size:10.0pt;color:#f00235">PRIVATE<br></span></b><b><span style="font-size:10.0pt;color:#f00235">T:</span></b><span style="font-size:10.0pt;color:gray"> </span><span style="font-size:10.0pt;color:#595959"><span style="color:rgb(102,102,102)"><a value="+447732481517">+44 (0)77 3248 1517</a></span> </span><b><span style="font-size:10.0pt;color:#f00235">|</span></b><span style="font-size:10.0pt;color:gray"> </span><b><span style="font-size:10.0pt;color:#f00235"> E:</span></b><span style="font-size:10.0pt;color:gray"> <a href="mailto:carrieromichele@gmail.com" target="_blank">carrieromichele@gmail.com</a></span><a href="http://@gmail.com" target="_blank"><span style="color:rgb(102,102,102)"><span style="font-size:10pt"></span></span></a></p>
<p><b><span style="font-size:10.0pt;color:#f00235">OFFICE<br>T:</span></b><span style="font-size:10.0pt;color:gray"> </span><span style="font-size:10.0pt;color:#595959"><span style="color:rgb(102,102,102)"><a value="+442082368992">+44 (0)20 8236 8992</a></span> </span><b><span style="font-size:10.0pt;color:#f00235">|</span></b><span style="font-size:10.0pt;color:gray"> </span><b><span style="font-size:10.0pt;color:#f00235"> E:</span></b><span style="font-size:10.0pt;color:gray"> </span><span style="color:rgb(102,102,102)"><span style="font-size:10pt"><a href="mailto:michele.carriero@evolve-analytics.com" target="_blank">michele.carriero@evolve-analytics.com</a></span><u><span style="font-size:10pt"><br>
</span></u></span><b><span style="font-size:10.0pt;color:#f00235">T:</span></b><span style="color:rgb(102,102,102)"><span style="font-size:10pt"> <a href="http://www.evolve-analytics.com" target="_blank">www.evolve-analytics.com</a></span></span></p>
<p><span style="color:rgb(102,102,102)"><span style="font-size:10pt"><a href="http://www.evolve-analytics.com" target="_blank"><br></a></span></span></p>
</div>