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

write_csv truncating numbers? #117

Closed
teucer opened this issue Apr 11, 2015 · 3 comments
Closed

write_csv truncating numbers? #117

teucer opened this issue Apr 11, 2015 · 3 comments

Comments

@teucer
Copy link

teucer commented Apr 11, 2015

In the simple example below, there is a difference between df01 and df02:

library(readr)

set.seed(1234)
n <- 1e3
dat <-  data.frame(a=as.integer(sample(1:1000,n,replace=TRUE)),
                 b=rnorm(n),
                 c=sample(c("foo","bar","baz","qux","quux"),n,replace=TRUE),
                 d=sample(c(TRUE,FALSE),n,replace=TRUE), 
                 stringsAsFactors=FALSE)

write.csv(dat,"test.csv",row.names = FALSE)
write_csv(dat,"test1.csv")

df01 <- read_csv("test.csv")
df02 <- read_csv("test1.csv")
@hadley
Copy link
Member

hadley commented Apr 16, 2015

A some what smaller reproducible example:

input <- runif(100)
output <- read_csv(write_csv(data.frame(input), ""))$input

all.equal(input, output)

@hadley hadley closed this as completed in 20de5b5 Apr 16, 2015
@hadley
Copy link
Member

hadley commented Apr 16, 2015

Ooops, have now gone too far in the opposite direction.

@hadley hadley reopened this Apr 16, 2015
@hadley
Copy link
Member

hadley commented Apr 20, 2015

Closed 0e4cc5e

@hadley hadley closed this as completed Apr 20, 2015
@lock lock bot locked and limited conversation to collaborators Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants