write_odf | R Documentation |
Export data from an R data frame to a ZIP file that stores the data as Open Data Format.
write_odf(
x,
file,
languages = "all",
export_data = TRUE,
verbose = TRUE,
compression_level = 5,
odf_version = "1.1.0"
)
x |
R data frame (df) to be writtem. |
file |
Path to ZIP file or name of zip file to save the odf-dataset in the working directory. |
languages |
Select the language in which the descriptions and labels of the data will be exported
|
export_data |
Choose, if you want to export the file that holds the data (data.csv).Default is TRUE. |
verbose |
Display more messages. |
compression_level |
A number between 1 and 9. 9 compresses best, but it also takes the longest. |
odf_version |
The ODF version of the output file. Default is the actual/most recent version.
|
ZIP file and unzipped directory containing the data as CSV file and the metadata as XML file (DDI Codebook 2.5.).
# get example data from the opendataformat package
df <- get(data("data_odf"))
# write R data frame with attributes to the file my_data.zip specified
# as Open Data Format.
write_odf(x = df, paste0(tempdir(), "/my_data.zip"))
# write R data frame with attributes to the file my_data.zip
# with selected language.
write_odf(x = df, paste0(tempdir(), "/my_data.zip"), languages = "en")
# write R data frame with attributes to the file my_data.zip but only
# metadata, no data.
write_odf(x = df, file = paste0(tempdir(), "/my_data.zip"), export_data = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.