Description Usage Arguments Examples
Bugfix for the standard utils::write.table-function, copied from the standard-function and adapted. When using nested data.frames and quote=TRUE, the original function first looks at which "columns" are character of factor, and marks these for quoting, then flattens the structure to a matrix. This functions also inspects columns that are data.frames or comparable. See the example for the difference.
1 2 3 4 |
x, file, append, quote, sep, eol, na, dec |
See |
row.names, col.names, qmethod, fileEncoding |
See |
1 2 3 4 5 6 7 8 | df <- data.frame(a='One;Two;Three',
b=I(data.frame(c="OtherVal",
d='Four;Five;Six',
e=4)))
write.table(df, "~/Desktop/Tempfile.csv", quote = TRUE, col.names = NA,
sep = ";", dec = ",", qmethod = "double")
# This fails for utils::write.table, because Four;Five;Six is unquoted, rendering the csv useless
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.