dct_options {dwctaxon}R Documentation

Get and set function arguments via options

Description

Changes the default values of function arguments.

Usage

dct_options(reset = FALSE, ...)

Arguments

reset

Logical vector of length 1; if TRUE, reset all options to their default values.

...

Any number of argument = value pairs, where the left side is the name of the argument and the right side is its value. See Details and Examples.

Details

Use this to change the default values of function arguments. That way, you don't have to type the same thing each time you call a function.

The arguments that can be set with this function are as follows:

Validation arguments

Editing arguments

General arguments

Value

Nothing; used for its side-effect.

Examples

# Show all options
dct_options()

# Store existing settings, including any changes made by the user
old_settings <- dct_options()

# View one option
dct_options()$valid_tax_status

# Change one option
dct_options(valid_tax_status = "accepted, weird, whatever")
dct_options()$valid_tax_status

# Reset to default values
dct_options(reset = TRUE)
dct_options()$valid_tax_status

# Multiple options may also be set at once
dct_options(check_taxon_id = FALSE, check_status_diff = TRUE)

# Reset options to those before this example was run
do.call(dct_options, old_settings)

[Package dwctaxon version 2.0.3 Index]