Skip to content

model$setInits(inits) gives terrible error with unnamed list elements #879

@danielturek

Description

@danielturek

The title says it all. This error should probably be caught somewhere (most likely in model$setInits(), and given a helpful error message.

Minimal example below:

library(nimble)

code <- nimbleCode({ a ~ dnorm(0, 1) })

inits <- list(a = 0, 1)   ## inits list has an unnamed element

Rmodel <- nimbleModel(code)

Rmodel$setInits(inits)
## Error: attempt to use zero-length variable name

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions