Skip to content

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

Closed

Description

@jmobrien

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)

Activity

  1. 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?[/+] on Aug 10, 2021
  2. jimhester commented on Aug 16, 2021

    @jimhester
    Collaborator

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

  3. jmobrien commented on Aug 17, 2021

    @jmobrien
    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)

  4. added a commit that references this issue on Apr 3, 2026
    866deca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions