muPar: Get or set default parameters for the package.

View source: R/macroutils2.r

muParR Documentation

Get or set default parameters for the package.

Description

Get or set default parameters for the package. Notice changes done to the parameter values are reset every time the R session is closed and the package is reloaded.

Usage

muPar(par = NULL, reset = FALSE, alphaNum, lastBinWd, timeSeriesValid)

Arguments

par

Three possible cases:

  • If par is NULL (default): All the actual value of the parameters will be silently returned.

  • If par is a vector of character strings representing parameter names. The value of the parameters named here will be (silently) returned.

  • If par is a list following the format tag = value, where tag is the name of the parameter to be changed, and value is its new value. Such a list is returned by muPar(). Notice that parameters can also be set individually, using the options listed below.

reset

Single logical. If TRUE, all the parameters will be set to their default value. Values are reset before any change to the parameter values, as listed below.

alphaNum

Vector of single characters. List of characters allowed in the column names when rmNonAlphaNum == TRUE.

lastBinWd

Single character string. Last folder in which some binary files were fetched.

timeSeriesValid

A valid R function. The first parameter of the function must accept a Date or POSIXct time series (as read from or exported to a BIN-file). The purpose of the function is to check that the time series is "valid". The default function isValidTimeSeries (set when the package is attached) will for example check that date-times in the time series are unique, sorted and regular(ly increasing). Set to NULL or function(x){TRUE} to cancel any check.

Details

The function has 3 possible, non-exclusive behaviours:

  • If reset=TRUE, resetting the parameters to their initial values, as defined in this function.

  • (Silently) returning the actual value of the package parameters. If par=NULL, all the values are returned. If par is a vector of parameter names, their value will be returned.

  • Setting-up the value of some parameters, passing a list of parameter value to par OR setting some of the parameters listed above.

Notice that when reset=TRUE and some new parameter values are provided, the parameters are first reset, and then the new parameter values are set. If par is a list, parameters are set first according to values in par, and then according to values in the parameters listed below. This combination is not recommended, but nonetheless possible.

The actual value of the parameters is stored in (and can be retrieved from) the environment rspPars. The default value of the parameters are stored in the environment rspPars. Do not use them directly.

Value

Returns a partial or complete list of (actual) parameter values, as a named list.

See Also

getMuPar.


julienmoeys/macroutils2 documentation built on Feb. 28, 2024, 2:17 a.m.