-
Notifications
You must be signed in to change notification settings - Fork 286
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_csv sometimes mis-identifies what type of column it should be reading and drops part of the column #1406
Comments
I'm using R v4.1.2, and readr v2.1.1, and have observed this behavior on multiple different systems. |
also #1411 |
related #1484 |
I have encountered the same issue today with readr 2.1.2 and R 4.3.0. For me it was columns with the popular marker gene '16S' which turns into Interestingly, it's not the same for every character: columns made out of 16X, 16O, and 16Z are identified as character columns, columns made out of 16D, 16S, 16L are identified as numeric columns. I wrote a quick script to automate 16A to 16Z, the following letters get cut off: D, E, F, L, and S. It also happens with their lower-case versions d, e, f, l, and s. Isn't that weird! Edit: these mostly correspond with the C++ numeric types - double, float, long, and short. Not sure about E, might be just parsed as a scientific number like 1e3. |
Duplicate of #1484 |
I have a file that has a first column value of "8D":
When I run it through read_csv, I expect to get:
Instead, what I get is:
The first column seems to be parsed as a
dbl
, rather than as achr
. I can force the expected behavior usingcol_types
, but this still strikes me as an issue that needs to be fixed.Confusingly, if the first column instead has the value "8A", the code behaves as expected.
Minimal example:
The text was updated successfully, but these errors were encountered: