tar_format_nanoparquet: Nanoparquet format

View source: R/tar_format_nanoparquet.R

tar_format_nanoparquetR Documentation

Nanoparquet format

Description

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.

Usage

tar_format_nanoparquet(compression = "snappy", class = "tbl")

Arguments

compression

Character string, compression type for saving the data. See the compression argument of nanoparquet::write_parquet() for details.

class

Character vector with the data frame subclasses to assign. See the class argument of nanoparquet::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)
})
}

wlandau/tarchetypes documentation built on Dec. 8, 2024, 4:44 p.m.