Constructor methods for inlabru component lists. Syntax details are given in
component()
.
Usage
component_list(object, lhoods = NULL, .envir = parent.frame(), ...)
# S3 method for class 'formula'
component_list(object, lhoods = NULL, .envir = parent.frame(), ...)
# S3 method for class 'list'
component_list(object, lhoods = NULL, .envir = parent.frame(), ...)
# S3 method for class 'component_list'
c(...)
# S3 method for class 'component'
c(...)
# S3 method for class 'component_list'
x[i]
Methods (by class)
component_list(formula)
: Convert a component formula into acomponent_list
objectcomponent_list(list)
: Combine a list of components and/or component formulas into acomponent_list
object
Methods (by generic)
c(component_list)
: The...
arguments should becomponent_list
objects. The environment from the first argument will be applied to the resultingcomponent_list
.
Functions
c(component)
: The...
arguments should becomponent
objects. The environment from the first argument will be applied to the resulting “component_list`.
Author
Fabian E. Bachl bachlfab@gmail.com and Finn Lindgren finn.lindgren@gmail.com
Examples
# As an example, let us create a linear component. Here, the component is
# called "myLinearEffectOfX" while the covariate the component acts on is
# called "x". Note that a list of components is returned because the
# formula may define multiple components
eff <- component_list(~ myLinearEffectOfX(main = x, model = "linear"))
summary(eff[[1]])
#> Label: myLinearEffectOfX
#> Type: main = linear, group = exchangeable, replicate = iid
#> Input: main = x, group = 1L, replicate = 1L, NULL
#> Map: Not yet initialised
#> INLA formula:
#> ~ . + f(myLinearEffectOfX, model =
#> BRU_myLinearEffectOfX_main_model)
# Equivalent shortcuts:
eff <- component_list(~ myLinearEffectOfX(x, model = "linear"))
eff <- component_list(~ myLinearEffectOfX(x))
# Individual component
eff <- component("myLinearEffectOfX", main = x, model = "linear")