Set Model Parameters

Share:

Description

Robustly replace model parameters by ignoring capitalisation and order of replacment.

Usage

1
setparms(parms, values, pnames = NULL, col = 1, slot = NA)

Arguments

parms

data object containing model parameters as a vector, a matrix or a non-nested list of vectors and matrices

values

vector or list of replacement values

pnames

if values is a vector or matrix: vector of parameter names that will be replaced

col

column in matrix-like parameter objects

slot

character, name of a single list element of parms

Value

the manipulated parms object (vector, matrix or list)

Examples

1
2
3
4
5
6
7
data(parms_salmo_other)
parms_salmo_other <- setparms(parms_salmo_other, c("YZP","dummy", "EPSMIN", "dtt"), c(0.7, 66, 0.77, 0.1))
parms_salmo_other

data(parms_salmo_phyto)
parms_salmo_phyto <- setparms(parms_salmo_phyto, c("TOPTX", "vs"), c(28, 0.22), c(1, 3))
# parms_salmo_phyto <- setparms(parms_salmo_phyto, "KP", c(1.4, 1.5, 1.6), 1:3) # not yet possible

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.