Set model parameters from a named list

PCMParamSetByName(
  model,
  params,
  inplace = TRUE,
  replaceWholeParameters = FALSE,
  deepCopySubPCMs = FALSE,
  failIfNamesInParamsDontExist = TRUE,
  ...
)

Arguments

model

a PCM model object

params

a named list with elements among the names found in model

inplace

logical indicating if the parameters should be set "inplace" for the model object in the calling environment or a new model object with the parameters set as specified should be returned. Defaults to TRUE.

replaceWholeParameters

logical, by default set to FALSE. If TRUE, the parameters will be completely replaced, meaning that their attributes (e.g. S3 class) will be replaced as well (dangerous).

deepCopySubPCMs

a logical indicating whether nested PCMs should be 'deep'-copied, meaning element by element, eventually preserving the attributes as in model. By default this is set to FALSE, meaning that sub-PCMs found in params will completely overwrite the sub-PCMs with the same name in model.

failIfNamesInParamsDontExist

logical indicating if an error should be raised if params contains elements not existing in model. Default: TRUE.

...

other arguments that can be used by implementing methods.

Value

If inplace is TRUE, the function only has a side effect of setting the parameters of the model object in the calling environment; otherwise the function returns a modified copy of the model object.