Learn R Programming

validate (version 0.1.4)

voptions: Set or get options globally or per object.

Description

Set or get options globally or per object.

Usage

voptions(x = NULL, ...)

## S3 method for class 'ANY': voptions(x = NULL, ...)

validate_options(...)

reset(x = NULL)

## S3 method for class 'ANY': reset(x = NULL)

## S3 method for class 'expressionset': voptions(x = NULL, ...)

## S3 method for class 'expressionset': reset(x = NULL)

Arguments

x
(optional) an object inheriting from expressionset such as validator or indicator.
...
Name of an option (character) to retrieve options or option = value pairs to set options.

Value

  • When requesting option settings: a list. When setting options, the whole options list is returned silently.

Options for the validate package

Currently the following options are supported.

  • raise ('none','error','all'; 'none') Control if theconfrontmethods catch or raise exceptions. The 'all' setting is useful when debugging validation scripts.
lin.eq.eps ('numeric'; 1e-8) The precision used when evaluating linear equalities. To be used to control for machine rounding. 'reset' Reset to factory settings.

Details

There are three ways in which options can be specified.
  • Globally. Settingvoptions(option1=value1,option2=value2,...)sets global options.
  • Per object. Settingvoptions(where=, option1=value1,...), causes all relevant functions that use that object (e.g.confront) to use those local settings.
At execution time. Relevant functions (e.g. confront) take optional arguments allowing one to define options to be used during the current function call

code

where

Examples

Run this code
# the default allowed validation symbols.
voptions('validator_symbols')

# set an option, local to a validator object:
v <- validator(x + y > z)
voptions(v,raise='all')
# check that local option was set:
voptions(v,'raise')
# check that global options have not changed:
voptions('raise')

Run the code above in your browser using DataLab