Learn R Programming

ParamHelpers (version 1.1-36)

Param: Create a description object for a parameter.

Description

For each parameter type a special constructor function is available, see below.

Usage

makeNumericParam(id, lower = -Inf, upper = Inf,
    trafo = NULL, requires = NULL)

makeNumericVectorParam(id, len, lower = -Inf, upper = Inf, trafo = NULL, requires = NULL)

makeIntegerParam(id, lower = -Inf, upper = Inf, trafo = NULL, requires = NULL)

makeIntegerVectorParam(id, len, lower = -Inf, upper = Inf, trafo = NULL, requires = NULL)

makeLogicalParam(id, requires = NULL)

makeLogicalVectorParam(id, len, requires = NULL)

makeDiscreteParam(id, values, requires = NULL)

makeDiscreteVectorParam(id, len, values, requires = NULL)

makeFunctionParam(id, requires = NULL)

makeUntypedParam(id, requires = NULL)

Arguments

id
[character(1)] Name of parameter.
len
[integer(1)] Length of vector parameter.
lower
[numeric] Lower bounds. A singe value of length 1 is automatically replicated to len for vector parameters. Default is -Inf.
upper
[numeric] Upper bounds. A singe value of length 1 is automatically replicated to len for vector parameters. Default is Inf.
values
[vector | list] Possible discrete values. Instead of using a vector of atomic values, you are also allowed to pass a list of quite complex R objects, which are used as discrete choices. If you do the latt
trafo
[NULL | function(x)] Function to transform parameter. It should be applied to the parameter value before it is, e.g., passed to a corresponding objective function. Function must accept a parameter value as the first argume
requires
[NULL | R expression] States requirements on other paramaters' values, so that setting this parameter only makes sense if its requirements are satisfied (dependent parameter). Only really useful if the parameter is included in a

Value

Details

The S3 class is a list which stores these elements: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Examples

Run this code
makeNumericParam("x",lower=-1, upper=1)
makeNumericVectorParam("x", len=2)
makeDiscreteParam("y", values=c("a","b"))

Run the code above in your browser using DataLab