Learn R Programming

nanonext (version 0.5.4)

nano_init: nanonext Initialise

Description

Initialise global options - intended to be called immediately after package load.

Usage

nano_init(warn = c("immediate", "deferred", "error", "none"))

Value

Invisibly, the integer code applied to options(warn = code).

Arguments

warn

[default 'immediate'] character string defining how to treat warnings generated by the package. 'immediate' to print warnings as they occur, 'deferred' to print warnings when evaluation returns to the top level, 'error' to upgrade all warnings to errors (stops execution), and 'none' to ignore all warnings.

Warnings

A warning is generated every time an 'errorValue' is returned.

This function sets the global option 'warn' to the appropriate value and automatically reverts it upon package unload. The default, applied by calling nano_init() with no arguments, is 'immediate', which prints warnings as they occur.

Further options for warnings may be set manually via options:

  • warning.expression - an R code expression to be called if a warning is generated, replacing the standard message. If non-null it is called irrespective of the value of option warn.

  • warning.length - sets the truncation limit in bytes for error and warning messages. A non-negative integer, with allowed values 100...8170, default 1000.

  • nwarnings - the limit for the number of warnings kept when warn = 0, default 50. This will discard messages if called whilst they are being collected. If you increase this limit, be aware that the current implementation pre-allocates the equivalent of a named list for them.