Sets the value of the given parameter.
setParameterValue(object, ..., lst = NULL, error = "warn")
Distribution or ParameterSet.
named parameters and values to update, see details.
optional list, see details.
character, value to pass to stopwarn
.
An R6 object of class ParameterSet.
$setParameterValue(..., lst = NULL, error = "warn")
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.
# 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