These functions are equivalent to
write_csv() etc., but instead
of writing to disk, they return a string.
format_delim(x, delim, na = "NA", append = FALSE, col_names = !append) format_csv(x, na = "NA", append = FALSE, col_names = !append) format_tsv(x, na = "NA", append = FALSE, col_names = !append)
A data frame to write to disk
Delimiter used to separate values. Defaults to
String used for missing values. Defaults to NA. Missing values
will never be quoted; strings with the same value as
Write columns names at the top of the file?
Factors are coerced to character. Doubles are formatted using the grisu3 algorithm. POSIXct's are formatted as ISO8601.
All columns are encoded as UTF-8.
write_excel_csv() also includes a
UTF-8 Byte order mark
which indicates to Excel the csv is UTF-8 encoded.
Values are only quoted if needed: if they contain a comma, quote or newline.
Florian Loitsch, Printing Floating-Point Numbers Quickly and Accurately with Integers, PLDI '10, http://www.cs.tufts.edu/~nr/cs257/archive/florian-loitsch/printf.pdf