Skip to content

write_csv should have option to quote character variables #653

Description

@rmcd1024

Perhaps I've missed an option, but I don't see how to have write_csv quote strings. This creates problems when strings look like integers.

library(readr)
write_csv(data.frame(a=c(rep("10", 1000), "01")), 'test1.csv')
x1 = read_csv('test1.csv')  ## a imported as integer, breaking last observation
write_csv(data.frame(a=c("01", rep("10", 1000))), 'test2.csv')
x2 = read_csv('test2.csv')  ## a imported correctly as character

Obviously in the read statements one could set guess_max=Inf, but it would be helpful to write quoted strings in the first place.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions