View source: R/export-dataset.R
exportDataset | R Documentation |
This function allows you to write a CrunchDataset to a .csv or SPSS .sav file.
exportDataset(
dataset,
file,
format = c("csv", "spss", "parquet"),
categorical = c("name", "id"),
na = NULL,
varlabel = c("name", "description"),
include.hidden = FALSE,
...
)
## S4 method for signature 'CrunchDataset'
write.csv(x, ...)
dataset |
CrunchDataset, which may have been subsetted with a filter expression on the rows and a selection of variables on the columns. |
file |
character local filename to write to |
format |
character export format: currently supported values are "csv" and "spss" (and experimental support for "parquet"). |
categorical |
character: export categorical values to CSV as category "name" (default) or "id". Ignored by the SPSS exporter. |
na |
Similar to the argument in
|
varlabel |
For SPSS export, which Crunch metadata field should be used as variable labels? Default is "name", but "description" is another valid value. |
logical: should hidden variables be included? (default: | |
... |
additional options. See the API documentation. Currently supported
boolean options include 'include_personal' for personal variables (default:
|
x |
(for write.csv) CrunchDataset, which may have been subsetted with a filter expression on the rows and a selection of variables on the columns. |
Invisibly, file
.
## Not run:
csv_file <- exportDataset(ds, "data.csv")
data <- read.csv(csv_file)
# parquet will likely read more quickly and be a smaller download size
parquet_file <- exportDataset(ds, "data.parquet")
# data <- arrow::read_parquet(parquet_file) # The arrow package can read parquet files
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.