Get or set values for a set of nodes in a model
values(model, nodes, accessorIndex)values(model, nodes, accessorIndex) <- value
A vector of values concatenated from the provided nodes in the model
a NIMBLE model object, either compiled or uncompiled
a vector of node names, allowing index blocks that will be expanded
For internal NIMBLE use only
value to set the node(s) to
NIMBLE development team
Access or set values for a set of nodes in a NIMBLE model.
Calling values(model, nodes)
returns a vector of the concatenation of values from the nodes requested
P <- values(model, nodes)
is a newer syntax for getValues(P, model, values)
, which still works and modifies P in the calling environment.
Calling values(model, nodes) <- P
sets the value of the nodes in the model, in sequential order from the vector P.
In both uses, when requested nodes are from matrices or arrays, the values will be handled following column-wise order.
The older function getValues(P, model, nodes)
is equivalent to P <- values(model, nodes)
, and the older function setValues(P, model, nodes)
is equivalent to values(model, nodes) <- P
These functions work in R and in NIMBLE run-time code that can be compiled.