qd_save | R Documentation |
Saves an object to disk using the qdata
format.
qd_save(object, file, compress_level = 3L,
shuffle = TRUE, warn_unsupported_types=TRUE,
nthreads = 1L)
object |
The object to save. |
file |
The file name/path. |
compress_level |
The compression level used (default 3). The maximum and minimum possible values depends on the version of ZSTD library used. As of ZSTD 1.5.6 the maximum compression level is 22, and the minimum is -131072. Usually, values in the low positive range offer very good performance in terms of speed and compression. |
shuffle |
Whether to allow byte shuffling when compressing data (default: |
warn_unsupported_types |
Whether to warn when saving an object with an unsupported type (default |
nthreads |
The number of threads to use when compressing data (default: |
No value is returned. The file is written to disk.
x <- data.frame(int = sample(1e3, replace=TRUE),
num = rnorm(1e3),
char = sample(state.name, 1e3, replace=TRUE),
stringsAsFactors = FALSE)
myfile <- tempfile()
qd_save(x, myfile)
x2 <- qd_read(myfile)
identical(x, x2) # returns true
# qdata support multithreading
qd_save(x, myfile, nthreads=1)
x2 <- qd_read(myfile, nthreads=1)
identical(x, x2) # returns true
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.