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.
Perhaps I've missed an option, but I don't see how to have
write_csvquote strings. This creates problems when strings look like integers.Obviously in the read statements one could set
guess_max=Inf, but it would be helpful to write quoted strings in the first place.