goldfish
goldfish copied to clipboard
Improve error message for elements not available in the formula
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When model specification includes actors' attributes that don't exist in the nodes' data frame, the error is not informative.
library(goldfish)
data("Social_Evolution")
callNetwork <- defineNetwork(nodes = actors, directed = TRUE)
callNetwork <- linkEvents(x = callNetwork, changeEvent = calls, nodes = actors)
callsDependent <- defineDependentEvents(events = calls, nodes = actors, defaultNetwork = callNetwork)
mod <- estimate(callsDependent ~ inertia + alter(actors$uno))
> Error in getElementFromDataObjectTable(objectNameTable, envir = envir)[[1]] :
> subscript out of bounds
Describe the solution you'd like An informative error indicating that the formula uses objects not available.