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
Right now, read_table() is (more or less) read_fwf() and read_table2() is read_delimited(); however, the expectation of most R users is that read_table() would behave like R's own read.table(), and expect a whitespace-delimited file.
IMHO read_table() should just read whitespace-delimited files, and read_table2() shouldn't exist. Users who actually want to read fixed-width files should use read_fwf().
This likely wouldn't break most usages since files readable by read_table() should also be accepted by read_table2().
The text was updated successfully, but these errors were encountered:
I agree this is confusing, however thing change may break existing behavior silently by allowing inputs which previously failed to be read. Maybe we will decide this is a worthwhile trade off for simplicity sake in the future.
I'd suggest this change is worth consideration. In personal use, I find read_table is far too strict for what I have to throw at it—for the worse stuff, read_table2 is still too strict. In many cases read_fwf is actually easier, when usable. To put some data behind my experience, searching GitHub returns
for a total of 62,487 files with read.table and 474,838 with read.csv, for a ratio of read.table/read.csv of 0.131596.
Those ratios are non-negligibly different, with means that
readr users are more likely to have data in CSV form,
when it comes to whitespace-delimited files, they're using something else, or
nothing at all, because there's too much error in the data (the numbers do bounce around).
On an absolute scale, the read_table numbers are still relatively small, so while changes may break some code (though likely most would continue to work identically), for now it's not so much that everybody would freak out. Probably.
Right now,
read_table()
is (more or less)read_fwf()
andread_table2()
isread_delimited()
; however, the expectation of most R users is thatread_table()
would behave like R's ownread.table()
, and expect a whitespace-delimited file.IMHO
read_table()
should just read whitespace-delimited files, andread_table2()
shouldn't exist. Users who actually want to read fixed-width files should useread_fwf()
.This likely wouldn't break most usages since files readable by
read_table()
should also be accepted byread_table2()
.The text was updated successfully, but these errors were encountered: