From 8e490687f4821d2d10e533579738545d3e3f1487 Mon Sep 17 00:00:00 2001 From: jgabry Date: Wed, 31 Aug 2016 11:47:50 -0400 Subject: [PATCH] get launch_shinystan_demo working without loading package --- NEWS.md | 5 ++++- R/launch_shinystan.R | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8c895630..16dd8248 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,11 @@ ### Version 2.2.1 * Better compatibility with latest releases of 'shinyjs' and 'DT' packages +* `shinystan::launch_shinystan_demo()` now works without first having to load +the package with a call to `library` ### Version 2.2.0-1 -* Fix bug in `deploy_shinystan` preventing some ShinyStan apps from being deployed +* Fix bug in `deploy_shinystan` preventing some ShinyStan apps from being +deployed ### Version 2.2.0 * Add optional argument `pars` to the `as.shinystan` method for stanfit objects, diff --git a/R/launch_shinystan.R b/R/launch_shinystan.R index f789c0c3..7e1d9bfa 100644 --- a/R/launch_shinystan.R +++ b/R/launch_shinystan.R @@ -123,8 +123,8 @@ launch_shinystan_demo <- function(demo_name = "eight_schools", rstudio = getOption("shinystan.rstudio"), ...) { demo_name <- match.arg(demo_name) - demo_object <- get(demo_name) - invisible(launch(demo_object, rstudio = rstudio, ...)) + data(list = demo_name, package = "shinystan", envir = environment()) + invisible(launch(get(demo_name, inherits = FALSE), rstudio = rstudio, ...)) } # Internal launch function