Skip to contents

write_blocks() writes a named list of block values to path with qs2::qs_save(). It is the only function of writeit that writes a blocks file.

Usage

write_blocks(values, path)

Arguments

values

A list that is not a data.frame. Each element has a name that is not NA and not empty, and no name is there twice. An empty list is allowed.

path

The path of the blocks file.

Value

path, invisibly.

Details

write_blocks() calls qs2::qs_save(values, path) with the defaults of qs2. The file keeps the attributes of values, so read_blocks() reads back an object identical to values.

Examples

path <- tempfile(fileext = ".qs2")
write_blocks(list(estimates = data.frame(term = "x", estimate = 1.2)), path)
read_blocks(path)
#> $estimates
#>   term estimate
#> 1    x      1.2
#> 
unlink(path)