-
Notifications
You must be signed in to change notification settings - Fork 285
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
read_fwf confused by ragged lines #469
Comments
Slightly more minimal reprex: txt <- paste(
" 7.98 6.74 7.75 8.00",
" 2.03 2.38",
" 5.82 5.09",
" 21.6 15.1 14.5 14.5",
sep = "\n"
)
read_fwf(txt, fwf_empty(txt))
read_fwf(txt, fwf_widths(c(8, 10, 14, 16))) I think the output from The output from |
@ghaarsma any thoughts on this problem? |
Agree with your assessment. |
@ghaarsma I think it might be that |
I think it's probably this code: |
In a slightly weird data, where missing values are simply indicated by terminating the line earlier, there seem to be a confusion with fwf_empty(tmp) and wrong output, while if given manually, the output is right but shows many parsing warnings?
It is ok with read.fwf:
wid <- c(8, 10, 14, 16)
read.fwf(tmp, wid) # works
But several issues with read_fwf:
fwf_empty(): wrong output
fwf_widths(): right output but parsing warnings?
The text was updated successfully, but these errors were encountered: