This function creates a definition for a nimbleList. The types
argument defines the names, types, and dimensions of the elements of the nimbleList. Elements of nimbleLists can be either basic types (e.g., integer
, double
) or other nimbleList definitions.
The types
argument can be either a series of expressions of the form name = type(dim)
, or a list of nimbleType
objects.
nimbleList
returns a definition, which can be used to create instances of this type of nimbleList via the new()
member function.
Definitions can be created in R's general environment or in nimbleFunction setup code. Instances can be created using the new()
function in R's global environment, in nimbleFunction setup code, or in nimbleFunction run code.
Instances of nimbleList
definitions can be used as arguments to run code of nimbleFunctions, and as the return type of nimbleFunctions.