update parameters within a list of parameters
# S3 method for params_pansim
update(object, ..., delete_regex = NULL, .list = FALSE)
a params_pansim
object
a list of named elements, or a single named list if .list
is specified
vector of regular expressions to remove
treat the first argument as a named list?
pp <- list(params = c(a=2,b=1))
object <- c(a=1, b=0)
class(object) <- "params_pansim"
update(object,pp,.list=TRUE)
#> a b
#> 2 1
pp2 <- list(params = c(a=2))
update(object,pp, .list=TRUE)
#> a b
#> 2 1
update(object, a=2)
#> a b
#> 2 0
update(object, a=2, b=1)
#> a b
#> 2 1
update(object, cc1=2, cc2=3)
#> a b cc1 cc2
#> 1 0 2 3
update(object, delete_regex="cc")
#> a b
#> 1 0