| zstd_in | R Documentation |
Substitutes a zstd compressed file for a regular input file. The zstd compressed
file is decompressed to the input FUN.
Substitutes a zstd compressed file for a regular output file. The output of FUN is
converted to a zstd compressed file at the target zstd file path.
zstd_in(
FUN,
...,
envir = parent.frame(),
tmpfile = tempfile(),
max_output_bytes = NULL
)
zstd_out(FUN, ..., envir = parent.frame(), tmpfile = tempfile())
FUN |
Function to call. |
... |
Arguments passed to |
envir |
Environment for |
tmpfile |
Intermediate file path used during conversion. It is removed on exit, whether supplied or auto-generated. |
max_output_bytes |
Optional maximum number of decompressed output bytes
passed through to |
This is a generic wrapper that works with any function that reads from a file.
This is a generic wrapper that works with any function that writes to a file.
The value returned by FUN.
The value returned by FUN, with its visibility preserved.
if (requireNamespace("data.table", quietly = TRUE)) {
zfile <- tempfile(fileext = ".csv.zst")
zstd_out(data.table::fwrite, mtcars, file = zfile)
dt <- zstd_in(data.table::fread, file = zfile)
print(nrow(dt))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.