-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fread ignores first 2 lines of file with tabs after data in several lines #1416
Comments
It seems the |
now I get > fread("iterations.txt")
V1 V2 V3 V4 V5
1: 2 -3274352 63539392.790 23.6 NA
2: 3 -2166076 1108276.003 34.5 NA
...
98: 99 -1515355 1.227 1090.5 NA
99: 100 -1515354 1.222 1102.0 NA
V1 V2 V3 V4 V5
Warning message:
In fread("iterations.txt") :
Starting data input on line 3 <<2 -3274351.940 63539392.790 23>> with 5 fields and discarding line 2 <<1 -66813744.730 - 12.3>> before it because it has a different number of fields (4). above, without > fread("iterations.txt", fill=TRUE)
Iteration EstimatedLogLikelihood Change TotalTimeSec V5
1: 1 -66813745 - 12.3 NA
2: 2 -3274352 63539392.790 23.6 NA
...
99: 99 -1515355 1.227 1090.5 NA
100: 100 -1515354 1.222 1102.0 NA
Iteration EstimatedLogLikelihood Change TotalTimeSec V5
> above, with this was with data table 1.10.5 > devtools::session_info()
Session info -------------------------------------------------------------------
setting value
version R version 3.3.3 (2017-03-06)
system i686, linux-gnu
ui X11
language en_US
collate en_US.UTF-8
tz posixrules
date 2017-05-25
Packages -----------------------------------------------------------------------
package * version date source
bitops 1.0-6 2013-08-17 CRAN (R 3.2.2)
caTools 1.17.1 2014-09-10 CRAN (R 3.2.2)
data.table * 1.10.5 2017-04-21 local
devtools 1.12.0 2016-12-05 CRAN (R 3.3.3)
digest 0.6.12 2017-01-27 cran (@0.6.12)
lattice * 0.20-34 2016-09-06 CRAN (R 3.3.3)
memoise 1.0.0 2016-01-29 CRAN (R 3.2.2)
namedCapture * 2017.01.15 2017-04-29 Github (tdhock/namedCapture@1da425b)
RColorBrewer * 1.1-2 2014-12-07 CRAN (R 3.2.2)
RCurl * 1.96-0 2016-08-07 local
requireGitHub 2017.03.16 2017-04-29 Github (tdhock/requireGitHub@5de2020)
RJSONIO * 1.3-0 2014-07-28 CRAN (R 3.2.2)
RSelenium * 1.3.6 2016-11-09 Github (ropensci/RSelenium@22f06b9)
withr 1.0.1 2016-02-04 CRAN (R 3.2.2)
XML * 3.99-0 2016-08-07 local
> |
this issue is still active, i.e. I am still getting an un-informative message -- it would be much more helpful if you could tell the user to do fill=TRUE.
|
actually never mind, the message does say fill=TRUE now, so i'm closing this |
To see the problem please download https://gist.githubusercontent.com/tdhock/bc1d9c0a76e4df386199/raw/fe436fb41e42c9ba89d8b567abfca587d323aa36/iterations.txt
and then run
The problem seems to be that the first two lines do not have a trailing tab but all the rest of the lines do (screenshot from emacs which highlights all the tab characters):
I expected the output of read.table:
Thanks for looking into this,
The text was updated successfully, but these errors were encountered: