Thin wrapper around base::options() for the ksCompare.* namespace.
Accepts the same argument names as ks_comp_options() (without the
ksCompare. prefix) and forwards them into base::options(),
returning the previous values invisibly so the call can be unwound
with base::options() or withr::with_options().
Arguments
- ...
Named arguments. Recognised names match the formals of
ks_comp_options():na_equal,sas_special_missing,compare_labels,compare_formats,str_trim,str_case,str_norm,tz,path. A single unnamedks_comp_optionsobject may also be passed in, in which case all of its fields are pushed.
Value
Invisibly, a named list of the previous values (suitable for
do.call(options, prev) to restore).
Details
Globals set this way become the new defaults of
ks_comp_options() (and therefore of ks_compare() when no
options = argument is supplied).
Examples
old <- ks_set_comp_options(path = tempfile("ksCompare_"), str_case = "fold")
ks_comp_options()$path
#> [1] "/tmp/RtmpLltSiF/ksCompare_430392a7725f3"
do.call(options, old) # restore
