Description Usage Arguments Note Author(s) Examples
A simple wrapper for writing common data formats. The format is determined
by the extension given in file
. Flat files are written with readr,
and the encoding is always UTF-8
. For xlsx, the function uses
to_excel
(which in turn uses openxlsx).
1 2 3 4 5 6 7 8 9 10 | write_data(x, file, ..., delim = NULL)
## S3 method for class 'data.frame'
write_data(x, file, ..., delim = NULL)
## S3 method for class 'list'
write_data(x, file, ...)
## S3 method for class 'ggplot'
write_data(x, file, ...)
|
x |
The data to be written. ( |
file |
Path and filename of output. |
... |
Further arguments passed to underlying functions.
(Currently: |
delim |
The delimiter to use when writing flat files. |
Use lapply
to write a list of data to flat files (csv, txt etc).
Kristian D. Olsen
1 2 3 4 5 | ## Not run:
df <- data.frame("String" = c("A", "B"), "Int" = c(1:2L), "Percent" = c(0.5, 0.75))
write_data(df, file = "example data.csv")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.