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_table corrupts last column names #166
Comments
That isn't a valid format for |
(Note: a cut/paste error means the headers in my above example weren't aligned)
The above (with aligned column starts) still causes a column misread: > read_table("test.txt", col_names=TRUE)
MAID TIME AMT\n1.0000
1 1 0 2.5
2 1 0 0.0 But if I pad the column names they are read correctly:
> read_table("test.txt", col_names=TRUE)
MAIDxxxxxx TIMExxxxxx AMTxxxxxxx
1 1 0 2.5
2 1 0 0.0 So length of column names must match the data width for read_table()? This is related to issue #121, because read_table() works about 20x faster than read.table() on NONMEM files, with the only problem being the parsing of the header for column names. |
|
If the problem is just reading the header row, maybe you should just skip it and read it yourself? |
That's what I've done for now, but I would hazard that the probability that the column names are ever the same width as the data in a FWF is very very low, and the times when the current read_table header parsing works as a user expects would be rare. Would there be any benefit to parsing the header slightly differently by default for fwf? Or as an option e.g. Or am I an outlier? :) |
When reading a simple whitespace separated file with read_table()
The parsed colname for the final column is corrupt:
The text was updated successfully, but these errors were encountered: