Learn R Programming

ParamHelpers (version 1.8)

getLower: Get lower / upper bounds and allowed discrete values for parameters.

Description

getLower and getUpper return a numerical vector of lower and upper bounds, getValues returns a list of possible value sets for discrete parameters.

Parameters for which such bound make no sense - due to their type - are not present in the result.

Usage

getLower(par.set, with.nr = FALSE)
getUpper(par.set, with.nr = FALSE)
getValues(par.set)

Arguments

par.set
[ParamSet] Parameter set.
with.nr
[logical(1)] Should number from 1 to length be appended to names of vector params? Default is FALSE.

Value

[vector | list]. Named by parameter ids.

Examples

Run this code
ps = makeParamSet(
  makeNumericParam("u"),
  makeIntegerParam("v", lower = 1, upper = 2),
  makeDiscreteParam("w", values = 1:2),
  makeNumericVectorParam("x", len = 2, lower = c(0, 10), upper = c(1, 11))
)
getLower(ps)
getUpper(ps)

ps = makeParamSet(
  makeNumericParam("u"),
  makeDiscreteParam("v", values = c("a", "b")),
  makeDiscreteParam("w", values = list(a = list(), b = NULL))
)
getValues(ps)

Run the code above in your browser using DataLab