Nanoparquet storage format for data frames.
Uses nanoparquet::read_parquet()
and nanoparquet::write_parquet()
to read and write data frames returned by targets in a pipeline.
Note: attributes such as dplyr
row groupings and posterior
draws info are dropped during the writing process.
Arguments
- compression
Character string, compression type for saving the data. See the
compression
argument ofnanoparquet::write_parquet()
for details.- class
Character vector with the data frame subclasses to assign. See the
class
argument ofnanoparquet::parquet_options()
for details.
Value
A targets::tar_format()
storage format specification string
that can be directly supplied to the format
argument of
targets::tar_target()
or targets::tar_option_set()
.
Examples
if (identical(Sys.getenv("TAR_LONG_EXAMPLES"), "true")) {
targets::tar_dir({ # tar_dir() runs code from a temporary directory.
targets::tar_script({
library(targets)
libary(tarchetypes)
list(
tar_target(
name = data,
command = data.frame(x = 1),
format = tar_format_nanoparquet()
)
)
})
tar_make()
tar_read(data)
})
}