muPar {macroutils}R Documentation

Get or set default parameters for the package.


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


muPar(par = NULL, reset = FALSE, dateMethod, removeSpace, alphaNumOnly,
  stripRunID, tz, alphaNum, header, lastBinWd)



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 indivudually, using the options listed below.


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.


Single integer. If 1 uses a new (shorter) method for converting dates (from the weird bin file format to POSIXct), if 2 uses the old / slower method implemented for the SOIL model (and MACRO?) and if 0 (or any other value than 1 or 2) returns the original date in minutes since 2 days before the 1st of January of year 0001 at 00:00. For 1 and 2 the date returned is POSIXct with time-zone tz, and for 0 it is integers.


Single logical. If TRUE remove extra spaces and minus signs in column names and replace them by underscores _. Multiple spaces are grouped. Trailing (end) space(s) are always removed (whatever is the value of removeSpace). If gui is TRUE, removeSpace is ignored, and a menu will ask you what to do.


Single logical. If TRUE remove all non alpha-numeric characters from the column names (and replace them by underscores). See also the alphaNum parameter. Use this option to obtain database compatible column names. If gui is TRUE, alphaNumOnly is ignored, and a menu will ask you what to do.


Single logical. If TRUE remove the simulation ID at the end of each column name. removeSpace must be TRUE for using this option (otherwise ignored). If gui is TRUE, stripRunID is ignored, and a menu will ask you what to do.


Single character string. "A timezone specification to be used for the conversion. System-specific (see as.POSIXlt), but "" is the current time zone, and "GMT" is UTC".


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


Single logical. If TRUE the header is present in the bin file, if FALSE it is not present.


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


The function has 3 possible, non-exclusive behaviours:

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.


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

See Also


[Package macroutils version 1.8.2 Index]