Write an IVT table to CSV
Usage
ivt_write_csv(
x,
path = NULL,
labels = TRUE,
dim_names = c("slug", "label"),
language = "en",
...
)Arguments
- x
An
ivtobject fromread_ivt().- path
Output
.csvpath. Defaults to<product_id>.csvin the data cache (ivt_cache_dir("data")).- labels
Passed to
ivt_tidy(): write labelled columns (TRUE, default) or the compact integer-id table (FALSE).- dim_names
How to name the data-dimension columns (passed to
ivt_tidy()and the member sidecar):"slug"(default, the terse structural slug) or"label"(the full dimension name). Slug columns can be labelled on read withlabel_ivt_columns().- language
Output language for labels and label-derived column names (passed to
ivt_tidy()):"en"(default) or"fr". The member sidecar carries both languages regardless.- ...
Passed to the CSV writer (
readr::write_csv()if available, elseutils::write.csv()).
Examples
path <- system.file("extdata", "98100044.ivt", package = "canivt")
ivt <- read_ivt(path)
out <- ivt_write_csv(ivt, file.path(tempdir(), "98100044.csv"))
file.exists(out)
#> [1] TRUE
