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
I am aware of #549 and #1037, but it does not really address my problem. Additionally, I already filed a similar bug report on the lubridate repo as I am unsure whether the responsibility to handle the following issue falls on readr or lubridate...
Here's a regex of my issue:
df<- tibble(x= duration(1, "years")) # x is a durationtmp<- tempfile(); write_csv(df, tmp) # write the df to filedf2<- read_csv(tmp) # x is now a character which can't be easily coerced
The main issue is that as.duration(as.character(duration(1, "years")))) returns NA because the parser from the duration class is designed with a different purpose in mind.
Now, I get that one could just convert a duration as a numeric before writing, via mutate(across(where(is.duration), as.numeric)).
But while I understand that readr can't handle every class out there, I was expecting the duration class, being provided by a tidyverse package, to be handled "properly" by write_csv.
Thoughts?
The text was updated successfully, but these errors were encountered:
Hi,
I am aware of #549 and #1037, but it does not really address my problem. Additionally, I already filed a similar bug report on the
lubridate
repo as I am unsure whether the responsibility to handle the following issue falls onreadr
orlubridate
...Here's a regex of my issue:
The main issue is that
as.duration(as.character(duration(1, "years"))))
returnsNA
because the parser from the duration class is designed with a different purpose in mind.Now, I get that one could just convert a duration as a numeric before writing, via
mutate(across(where(is.duration), as.numeric))
.But while I understand that
readr
can't handle every class out there, I was expecting the duration class, being provided by atidyverse
package, to be handled "properly" bywrite_csv
.Thoughts?
The text was updated successfully, but these errors were encountered: