| write_vtr | R Documentation |
For vectra_node inputs (lazy queries from any format: CSV, SQLite, TIFF,
or another .vtr), data is streamed batch-by-batch to disk without
materializing the full result in memory. Each batch becomes one row group.
The output file is written atomically (via temp file + rename) so readers
never see a partial file.
write_vtr(
x,
path,
compress = c("fast", "small", "none"),
batch_size = NULL,
col_types = NULL,
quantize = NULL,
spatial = NULL,
...
)
x |
A |
path |
File path for the output .vtr file. |
compress |
Compression level: |
batch_size |
Target number of rows per row group in the output file.
Defaults to 131072 for data.frames (1 MB per double column, cache-friendly
for decompression). For nodes, defaults to |
col_types |
Optional named character vector specifying narrow integer
storage types. Names must match column names; values must be |
quantize |
Optional named list for lossy quantization of |
spatial |
Optional list for 2D spatial predictor encoding. Either a
global spec applied to all numeric columns ( |
... |
Additional arguments passed to methods. |
For data.frame inputs, the data is written directly from memory.
Invisible NULL.
# From a data.frame
f <- tempfile(fileext = ".vtr")
write_vtr(mtcars, f)
# Streaming format conversion (CSV -> VTR)
csv <- tempfile(fileext = ".csv")
write.csv(mtcars, csv, row.names = FALSE)
f2 <- tempfile(fileext = ".vtr")
tbl_csv(csv) |> write_vtr(f2)
unlink(c(f, f2, csv))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.