You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Note: a cut/paste error means the headers in my above example weren't aligned)
So all values must take the same amount of space regardless of whether it's a header row or not?
MAID TIME AMT
1.0000E+00 0.0000E+00 2.5000E+00
1.0000E+00 0.0000E+00 0.0000E+00
The above (with aligned column starts) still causes a column misread:
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.
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. relaxed_headers = TRUE.
Activity
hadley commentedon May 7, 2015
That isn't a valid format for
read_table()- it excepts the whitespace columns to be in consistent positionscoolbutuseless commentedon May 10, 2015
(Note: a cut/paste error means the headers in my above example weren't aligned)
So all values must take the same amount of space regardless of whether it's a header row or not?
The above (with aligned column starts) still causes a column misread:
But if I pad the column names they are read correctly:
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.
hadley commentedon May 11, 2015
read_fwf()(and henceread_table()) expects every row to have the same number of charactershadley commentedon May 11, 2015
If the problem is just reading the header row, maybe you should just skip it and read it yourself?
coolbutuseless commentedon May 11, 2015
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.
relaxed_headers = TRUE.Or am I an outlier? :)