R/types_modelVariableAccessor.R

Defines functions modelVariableAccessorVector

## CASE 2: modelVariableAccessorVector
## copy(model1, xxx, nodes) becomes:
## model1_nodes_accessors <- modelVariableAccessorVector(model1, nodes)
## copy(model1_nodes_accessors, xxx)
## model1_nodes_accessors$getAccessors() returns a list of the modelVariableAccessor objects


modelVariableAccessorVector <- function(mv, nodeNames, logProb = FALSE, logProbOnly = FALSE) {
    ans <- list(mv, substitute(nodeNames), logProb | logProbOnly, parent.frame(), logProbOnly)
    class(ans) <- c('modelVariableAccessorVector', 'valuesAccessorVector')
    ans
}

Try the nimble package in your browser

Any scripts or data that you put into this service are public.

nimble documentation built on Sept. 11, 2024, 7:10 p.m.