shinystan
shinystan copied to clipboard
Allow specifying an environment when calling launch_shinystan
From @paul-buerkner in #109:
My idea was that
launch_shinystancould have anenv(or similar named) argument to specify the environment to look for the objects. With regard to brms, I wouldn't require users to specify this argument. Rather, it would be set automatically be the function calling shinystan, e.g:launch_shiny.brmsfit <- function(x, rstudio = getOption("shinystan.rstudio"), ...) { y <- model.response(model.frame(x)) y_rep <- predict(x, summary = FALSE) shinystan::launch_shinystan(x$fit, rstudio = rstudio, env = environment(), ...) }I am not sure though, if this is the best way to find y and y_rep computed within the function calling shinystan.