Skip to content
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

Is there a reason why write_rds() doesn't include/pass the ascii param? #1270

Closed
jmobrien opened this issue Aug 9, 2021 · 2 comments
Closed

Comments

@jmobrien
Copy link

jmobrien commented Aug 9, 2021

Unlike saveRDS() in base R, write_rds() includes no option for writing in ASCII rather than in binary. Is there a reason why that was left out? In my particular use case having the option for ascii writing using the more standardized readr functions would be nice.

(wrote RDA rather than RDS for some reason, amended)

@jmobrien jmobrien changed the title Is there a reason why write_rda() doesn't include/pass the ascii param? Is there a reason why write_rds() doesn't include/pass the ascii param? Aug 10, 2021
@jimhester
Copy link
Collaborator

Thanks for opening the issue, I added a text argument to write_rds(), which is analogous to the ascii argument in saveRDS.

@jmobrien
Copy link
Author

Great! Noticed something else last week related to this--in saveRDS(), ascii=TRUE (or, here, text=TRUE) drops any tagged NA's that were loaded/created by haven. Binary saves work just fine.

I assume there's nothing to be done about that, but since it's a variation in behavior with relevance to other tidyverse packages, I thought it was worth mentioning in case that's the sort of thing the team wants to document.

(For what it's worth, nothing in the docs of either saveRDS() or save() would clearly suggest this behavior either)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants