-
Notifications
You must be signed in to change notification settings - Fork 982
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
fread/fwrite default options for NA mismatch #2281
Comments
Appears to be the same issue as #2214 |
Thanks I saw the issue you re refering to but I thought it was a similar but different problem. |
Care to elaborate?
…On Thu, Aug 3, 2017 at 12:58 PM, benoit ***@***.***> wrote:
Thanks I saw the issue you re refering to but I thought it was a similar
but different problem.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2281 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHQQdQ_M3FMV9dhd2emJte6qCvyxjgMZks5sUiZWgaJpZM4Oscyu>
.
|
Just it looked like the other issue is more involved and requires more changes than this one but all fine ;) |
Thanks @BenoitLondon. Agree. > dt <- data.table(a = c(NA_integer_, 1L, 2L), b = c("a", "b", NA_character_))
> tmp <- tempfile()
> fwrite(dt, tmp)
> dt2 <- fread(tmp)
> dt
a b
1: NA a
2: 1 b
3: 2 <NA>
> dt2
a b
1: NA a
2: 1 b
3: 2 <NA>
> identical(dt,dt2)
[1] TRUE |
I think this is still not fixed ? Or back with an issue ? Should default in fwrite for NA not be ... NA ?
|
Cannot reproduce on |
Hi,
first thank you for this package. :)
I had a problem when saving and reading a csv with fread and fwrite
So I realised fread and fwrite have different default for na(-strings), so I checked read.csv and write.csv and they use the same default option.
In the end it mixes empty strings with NA which is not an expected default behavior imho.
Shouldn't fwrite use the same default option as write.csv i.e. na = "NA" or NA? so that a call to fread after fwrite would recover the same object?
Cheers,
Benoit
The text was updated successfully, but these errors were encountered: