Learn R Programming

distr6 (version 1.1.0)

setParameterValue: Parameter Value Setter

Description

Sets the value of the given parameter.

Usage

setParameterValue(object, ..., lst = NULL, error = "warn")

Arguments

object

Distribution or ParameterSet.

...

named parameters and values to update, see details.

lst

optional list, see details.

error

character, value to pass to stopwarn.

Value

An R6 object of class ParameterSet.

R6 Usage

$setParameterValue(..., lst = NULL, error = "warn")

Details

Parameters can be updated in one of two ways, either by passing the parameters to update as named arguments or as a list with the the list names are parameter IDs and the list values are the respective values to set the parameters. Using a list may be preferred for parameters that take multiple values. See examples. If lst is given then any additional arguments are ignored.

stopwarn either breaks the code with an error if "error" is given or returns NULL with warning otherwise.

See Also

parameters and setParameterValue

Examples

Run this code
# NOT RUN {
ps <- Normal$new()$parameters()
ps$setParameterValue(mean  = 2, var = 5)$print()

ps <- MultivariateNormal$new()$parameters()
ps$setParameterValue(lst = list(mean = c(1,1)))$print()

# }

Run the code above in your browser using DataLab