Convert a data frame or tibble to a file in a temporary location, and return the file path. The file name will be based on the variable name of the object, and will be given an extension that corresponds to the method by which the file was saved. The 'file_format' can be specified as "csv" (comma-separated file), "tsv"/"txt" (tab-delimited), or "xlsx".
1 2 | data_to_file(data, file_format = "csv", file_name = NULL,
col_names = TRUE)
|
data |
A data frame or tibble to be converted into a file. |
file_format |
A file_format which will determine how the data is saved and the extension of the resulting file. Currently supports "csv" (comma- separated), "tsv" (tab-separated), or "xlsx"/"excel". Defaults, "csv" (comma-separated) |
file_name |
Sets the name of the saved file, without the extension. If this isn't provided, the name of the 'data' variable will be used. "." is a forbidden 'file_name' for this function, and is usually provided by a pipe ( string of random numbers. |
col_names |
Determines if column names (headers) are to be included. Defaults to TRUE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.