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 adds quotes to tibble column with double quotations #854

Closed
ChiWPak opened this issue May 21, 2018 · 2 comments
Closed

write_tsv adds quotes to tibble column with double quotations #854

ChiWPak opened this issue May 21, 2018 · 2 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@ChiWPak
Copy link

ChiWPak commented May 21, 2018

I'm encountering a similar issue as posted on stackoverflow in Feb 2018 - it has no solutions

https://stackoverflow.com/questions/48694547/using-readr-to-read-tsv-where-some-fields-have-quotes-after-writing-back-out-t

A string-column containing double quotations is printed out to file with an extra set of quotes around the entire string when using write_tsv (I can't tell if this is because of tibble or write_tsv)

A reproducible example with comparison to write.table

options(useFancyQuotes = FALSE)
df <- data.frame(A = paste("val is", dQuote("ok")))
out1 <- "readr_out.tsv"
out2 <- "baser_out.tsv" 
write_tsv(df, out1, col_names=FALSE)
# "val is ""ok""" 
write.table(df, out2, sep = '\t', quote = FALSE, row.names = FALSE, col.names=FALSE)
# val is "ok"
@jimhester jimhester added the bug an unexpected problem or unintended behavior label Nov 13, 2018
@jimhester
Copy link
Collaborator

You can now use the quote_escape parameter to control how quotes are escaped in the write functions.

@lock
Copy link

lock bot commented May 13, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators May 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants