When I run the example below a bunch of functions eg str.igraph are added to my global environment.
I was able to trace the creation of them to modelDefClass$methods(fixRStudioHanging = function(model). The comment in the code seems to say this was done in 2015 to deal with a problem with RStudio hanging. Is it still needed? Would it work if this function could accept the where argument that md$newModel() accepts? I am using it inside an R package and it is very confusing to users to have these appear.
code <- nimbleCode({
x ~ dnorm(mu, sd = 1)
mu ~ dnorm(0, sd = prior_sd)
})
constants = list(prior_sd = 1)
data = list(x = 4)
Rmodel <- nimbleModel(code, constants = constants, data = data)