Learn R Programming

qs2 (version 0.1.5)

qopt: qs2 Option Getter/Setter

Description

Get or set a global qs2 option.

Usage

qopt(parameter, value = NULL)

Value

If value is NULL, returns the current value of the specified option. Otherwise, sets the option and returns the new value invisibly.

Arguments

parameter

A character string specifying the option to access. Must be one of "compress_level", "shuffle", "nthreads", "validate_checksum", "warn_unsupported_types", or "use_alt_rep".

value

If NULL (the default), the current value is retrieved. Otherwise, the global option is set to value.

Details

This function provides an interface to retrieve or update internal qs2 options such as compression level, shuffle flag, number of threads, checksum validation, warning for unsupported types, and ALTREP usage. It directly calls the underlying C-level functions.

The default settings are:

  • compress_level: 3L

  • shuffle: TRUE

  • nthreads: 1L

  • validate_checksum: FALSE

  • warn_unsupported_types: TRUE (used only in qd_save)

  • use_alt_rep: FALSE (used only in qd_read)

When value is NULL, the current value of the specified option is returned. Otherwise, the option is set to value and the new value is returned invisibly.

Examples

Run this code
# Get the current compression level:
qopt("compress_level")

# Set the compression level to 5:
qopt("compress_level", value = 5)

# Get the current shuffle setting:
qopt("shuffle")

# Get the current setting for warn_unsupported_types (used in qd_save):
qopt("warn_unsupported_types")

# Get the current setting for use_alt_rep (used in qd_read):
qopt("use_alt_rep")

Run the code above in your browser using DataLab