qs_read: qs_read

View source: R/RcppExports.R

qs_readR Documentation

qs_read

Description

Reads an object that was saved to disk in the qs2 format.

Usage

qs_read(file, validate_checksum=FALSE, nthreads = 1L)

Arguments

file

The file name/path.

validate_checksum

Whether to validate the stored checksum in the file (default FALSE). This can be used to test for file corruption but has a performance penality.

nthreads

The number of threads to use when reading data (default: 1).

Value

The object stored in file.

Examples

x <- data.frame(int = sample(1e3, replace=TRUE),
        num = rnorm(1e3),
        char = sample(state.name, 1e3, replace=TRUE),
         stringsAsFactors = FALSE)
myfile <- tempfile()
qs_save(x, myfile)
x2 <- qs_read(myfile)
identical(x, x2) # returns true

# qs2 support multithreading
qs_save(x, myfile, nthreads=1)
x2 <- qs_read(myfile, nthreads=1)
identical(x, x2) # returns true

qs2 documentation built on Sept. 30, 2024, 9:44 a.m.

Related to qs_read in qs2...