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_tsv create fake decimals #1495

Closed
sylvainschmitt opened this issue May 12, 2023 · 3 comments
Closed

write_tsv create fake decimals #1495

sylvainschmitt opened this issue May 12, 2023 · 3 comments

Comments

@sylvainschmitt
Copy link

Dear developers thanks for the amazing work. However, I encountered a weird behavior from readr which seems to invent decimals:

  library(readr)
  cat("VPD\n0.852402144876029", file = "test_in.txt")
  read_tsv("test_in.txt") %>% 
    write_tsv(file = "test_out.txt")
  readLines("test_out.txt")
  # [1] "VPD"                 "0.85240214487602906"

I'm using readr 2.1.4

@sylvainschmitt
Copy link
Author

This issue is not occurring with base:

  cat("VPD\n0.852402144876029", file = "test_in.txt")
  read.delim("test_in.txt", sep = "\t") %>% 
    write.table(file = "test_out.txt", sep = "\t", 
                quote = FALSE, row.names = FALSE)
  readLines("test_out.txt")

And occurs only for few specific values.

@MarekGierlinski
Copy link

It might be related to issue #1502 I just reported.

@hadley
Copy link
Member

hadley commented Jul 31, 2023

Duplicate of #1502

@hadley hadley marked this as a duplicate of #1502 Jul 31, 2023
@hadley hadley closed this as completed Jul 31, 2023
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

3 participants