cdbkOpts: Options of package 'cdbk'

Description Usage Arguments Details Value Options Examples

View source: R/cdbkOpts.R

Description

Interface to package cdbk global options.

Usage

1
2
cdbkOpts(..., ns = "cdbk", oname = ".cdbk.options")
.cdbk.options # not exported

Arguments

...

Either a character vector giving the names of the options to read or a collection of expressions tag=value, see Details

ns

character, name of the namespace where the assignment should take place. Defaults to the namespace of package cdbk

oname

character, name of the object storing options

Details

Package options are stored in the unexported list called .cdbk.options. This function provides an interface, not unlike par or options, for this list.

The option values can be accessed using calls like cdbkOpts("optionname"), where "optionname" is a name of the option to get.

Options can be set using calls like cdbkOpts(optname=optvalue) where optname is the name of the option and optvalue is the new value for that option.

Value

If called without any arguments the function returns the list with all options.

If called with character vector as a single argument a list of options with names provided in the argument.

If called with a collection of tag=value statements a list with current option settings (before the new ones are applied).

If the function is called with some non-existent option names it throws a warning in case of reading and an error if setting.

Options

defvar

character vector with names of the functions used to produce default reports for a variable.

defdf

character vector of with names of the functions used to produce default reports for a data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# All options
cdbkOpts()

# get values of options 'defvar' and 'defdf'
cdbkOpts( c("defvar", "defdf") )

## Not run: 
# set values of options 'defvar' and 'defdf',
# 'op' is a list of all the options before 'foo' and 'bar' got new values
op <- cdbkOpts(defvar=1, defdf=2)
# TODO to be implemented: calling 'cdbkOpts' with a list
cdbkOpts(op)

## End(Not run)

mbojan/cdbk-old documentation built on Dec. 21, 2021, 3:56 p.m.