Open paciorek opened 6 years ago
There is a function called calcNodes
in the nimble namespace.
Options:
Decide this is not a problem worth solving, since any name that exists in the nimble namespace could cause this kind of confusion.
Try to enforce that objects only be looked up locally or from setup code. This would make sense, but it may be more pervasive than just copy
.
For this particular case, rename the nimble:::calcNodes
function, since I think it is only for internal use. This would fix the immediate confusion since calcNodes
is a common name in our examples, but it would not solve the problem that names that happen to coincide with something in the nimble namespace could cause confusing error messages.
This seems to only occur if 'calcNodes' is used and not 'calcNodes2' so seems like some sort of naming issue with names used internally in Nimble. I.e. presumably 'calcNodes' is found in some context where it shouldn't be and the fact that 'calcNodes' does not exist is not trapped as it should be. Here's the example:
Error occurs in: nimble/R/typesmodelValuesAccessor.R: isLogProbName <- substr(nodeNames, 1, 8) == 'logProb'
with nodeNames being a function rather than a character vector.