diff --git a/DESCRIPTION b/DESCRIPTION
index 9fc382ae..139e18e2 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: shinystan
Title: Interactive Visual and Numerical Diagnostics and Posterior Analysis for
Bayesian Models
-Version: 2.3.0
-Date: 2017-01-31
+Version: 2.4.0
+Date: 2017-08-01
Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"),
email = "jsg2201@columbia.edu"),
person(family = "Stan Development Team", role = "ctb"),
@@ -18,18 +18,19 @@ Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"),
Maintainer: Jonah Gabry
Description: A graphical user interface for interactive Markov chain Monte
Carlo (MCMC) diagnostics and plots and tables helpful for analyzing a
- posterior sample. The interface is powered by RStudio's Shiny web
- application framework and works with the output of MCMC programs written
- in any programming language (and has extended functionality for Stan models
- fit using the rstan and rstanarm packages).
-URL: https://github.com/stan-dev/shinystan/, http://mc-stan.org/
+ posterior sample. The interface is powered by the 'Shiny' web
+ application framework from 'RStudio' and works with the output of MCMC
+ programs written in any programming language (and has extended
+ functionality for 'Stan' models fit using the 'rstan' and 'rstanarm'
+ packages).
+URL: http://mc-stan.org/, http://discourse.mc-stan.org
BugReports: https://github.com/stan-dev/shinystan/issues/
License: GPL (>=3)
Depends:
R (>= 3.1.0),
- shiny (>= 0.12.1)
+ shiny (>= 1.0.3)
Imports:
- bayesplot (>= 1.1.0),
+ bayesplot (>= 1.2.0),
colourpicker,
DT (>= 0.2),
dygraphs (>= 1.1.1.2),
@@ -52,8 +53,8 @@ Suggests:
coda,
knitr (>= 1.9),
rmarkdown (>= 0.8.1),
- rstanarm (>= 2.14.1),
+ rstanarm (>= 2.15.3),
testthat
LazyData: true
VignetteBuilder: knitr
-RoxygenNote: 5.0.1
+RoxygenNote: 6.0.1
diff --git a/NAMESPACE b/NAMESPACE
index b15681fe..4024d40d 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,5 +1,7 @@
# Generated by roxygen2: do not edit by hand
+S3method(launch_shinystan,default)
+S3method(launch_shinystan,shinystan)
export(as.shinystan)
export(deploy_shinystan)
export(drop_parameters)
diff --git a/NEWS.md b/NEWS.md
index 6d29625c..6f353956 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,10 @@
+### Version 2.4.0
+
+* `launch_shinystan` is now an S3 generic with methods. This allows developers
+of packages that use __shinystan__ to create their own `launch_shinystan`
+methods instead of using a different function name or creating a naming
+conflict.
+
### Version 2.3.0
#### Fixes
diff --git a/R/deploy_shinystan.R b/R/deploy_shinystan.R
index d747c572..78e36584 100644
--- a/R/deploy_shinystan.R
+++ b/R/deploy_shinystan.R
@@ -11,9 +11,9 @@
# this program; if not, see .
-#' Deploy a ShinyStan app on the web using shinyapps.io by RStudio
+#' Deploy a 'ShinyStan' app on the web using 'shinyapps.io' by 'RStudio'
#'
-#' Requires a (free or paid) ShinyApps account. Visit
+#' Requires a (free or paid) 'ShinyApps' account. Visit
#' \url{http://www.shinyapps.io/} to sign up.
#'
#' @export
@@ -46,13 +46,13 @@
#' @seealso The example in the \emph{Deploying to shinyapps.io} vignette that
#' comes with this package.
#'
-#' \url{http://www.shinyapps.io/} to sign up for a free or paid ShinyApps
+#' \url{http://www.shinyapps.io/} to sign up for a free or paid 'ShinyApps'
#' account and for details on how to configure your account on your local
-#' system using RStudio's \pkg{\link[rsconnect]{rsconnect}} package.
+#' system using the \pkg{\link[rsconnect]{rsconnect}} package from 'RStudio'.
#'
#' @examples
#' \dontrun{
-#' # For this example assume sso is the name of the shinystan object for
+#' # For this example assume sso is the name of the \code{shinystan} object for
#' # the model you want to use. Assume also that you want to name your app
#' # 'my-model' and that your shinyapps.io username is 'username'.
#'
diff --git a/R/drop_parameters.R b/R/drop_parameters.R
index bd88db9b..f9544c62 100644
--- a/R/drop_parameters.R
+++ b/R/drop_parameters.R
@@ -11,13 +11,14 @@
# this program; if not, see .
-#' Drop parameters from a shinystan object
+#' Drop parameters from a \code{shinystan} object
#'
-#' Remove selected parameters from a shinystan object. This is useful if you
-#' have a very large shinystan object when you only want to look at a subset of
-#' parameters. With a smaller shinystan object, \code{\link{launch_shinystan}}
-#' will be faster and you should experience better performance (responsiveness)
-#' after launching when using the ShinyStan app.
+#' Remove selected parameters from a \code{shinystan} object. This is useful if
+#' you have a very large \code{shinystan} object when you only want to look at a
+#' subset of parameters. With a smaller \code{shinystan} object,
+#' \code{\link{launch_shinystan}} will be faster and you should experience
+#' better performance (responsiveness) after launching when using the
+#' 'ShinyStan' app.
#'
#' @export
#' @template args-sso
diff --git a/R/generate_quantity.R b/R/generate_quantity.R
index 2e517925..36a16ec5 100644
--- a/R/generate_quantity.R
+++ b/R/generate_quantity.R
@@ -21,7 +21,7 @@
#' @param fun Function to call, i.e. \code{function(param1)} or
#' \code{function(param1,param2)}. See Examples, below.
#' @param param1 Name of first parameter as character string.
-#' @param param2 Optional. Name of second paramter as character string.
+#' @param param2 Optional. Name of second parameter as character string.
#' @param new_name Name for the new parameter as character string.
#'
#' @return sso, updated. See Examples.
diff --git a/R/launch_shinystan.R b/R/launch_shinystan.R
index 7e1d9bfa..987f899b 100644
--- a/R/launch_shinystan.R
+++ b/R/launch_shinystan.R
@@ -11,24 +11,26 @@
# this program; if not, see .
-#' Launch the ShinyStan app
+#' Launch the 'ShinyStan' app
#'
-#' Launch the ShinyStan app in the default web browser. RStudio users also have
-#' the option of launching the app in RStudio's pop-up Viewer.
+#' Launch the 'ShinyStan' app in the default web browser. 'RStudio' users also
+#' have the option of launching the app in the pop-up Viewer.
#'
#' @export
-#' @param object An object of class shinystan, stanfit, or stanreg. To use other
-#' types of objects first create a shinystan object using
+#' @param object The object to use. For the default method this can be an object
+#' of class \code{"shinystan"}, \code{"stanfit"}, or \code{"stanreg"}. To use
+#' other types of objects first create a shinystan object using
#' \code{\link{as.shinystan}}.
-#' @param rstudio Only relevant for RStudio users. The default (\code{FALSE}) is
-#' to launch the app in the user's default web browser rather than RStudio's
-#' pop-up Viewer. Users can change the default to \code{TRUE} by setting the
-#' global option \code{options(shinystan.rstudio = TRUE)}.
+#' @param rstudio Only relevant for 'RStudio' users. The default (\code{FALSE})
+#' is to launch the app in the user's default web browser rather than the
+#' pop-up Viewer provided by 'RStudio'. Users can change the default to
+#' \code{TRUE} by setting the global option \code{options(shinystan.rstudio =
+#' TRUE)}.
#' @param ... Optional arguments passed to \code{\link[shiny]{runApp}}.
#'
#' @return The \code{launch_shinystan} function is used for the side effect of
-#' starting the ShinyStan app, but it also returns a shinystan object, an
-#' instance of S4 class \code{"shinystan"}.
+#' starting the 'ShinyStan' app, but it also returns a \code{shinystan}
+#' object, an instance of S4 class \code{"shinystan"}.
#'
#' @template seealso-as.shinystan
#' @template seealso-update_sso
@@ -69,31 +71,45 @@
#' # Example 3: 'fit' is an mcmc.list, array or list of matrices
#' #######################################
#'
-#' # First create shinystan object (see ?as.shinystan for full details)
-#' fit_sso <- as.shinystan(fit, model_name = "Example")
-#'
-#' # Now fit_sso is a shinystan object and so Example 1 (above) applies.
+#' # First create shinystan object (see ?as.shinystan) for full details)
#' }
#'
-launch_shinystan <- function(object,
- rstudio = getOption("shinystan.rstudio"),
- ...) {
- if (is.shinystan(object)) {
- sso_check(object)
- } else if (is.stanreg(object) || is.stanfit(object)) {
- message("\nCreating shinystan object...")
+launch_shinystan <- function(object, ...) {
+ UseMethod("launch_shinystan")
+}
+
+#' @rdname launch_shinystan
+#' @export
+launch_shinystan.default <-
+ function(object,
+ ...,
+ rstudio = getOption("shinystan.rstudio")) {
+ if (!is.shinystan(object) &&
+ !is.stanfit(object) &&
+ !is.stanreg(object)) {
+ stop("object not compatible with 'launch_shinystan'. ",
+ "Try converting to a shinystan object first using 'as.shinystan'.")
+ }
object <- as.shinystan(object)
+ message("\nLaunching ShinyStan interface... ",
+ "for large models this may take some time.")
+ invisible(launch(object, rstudio, ...))
+ }
+
+#' @rdname launch_shinystan
+#' @export
+launch_shinystan.shinystan <-
+ function(object,
+ ...,
+ rstudio = getOption("shinystan.rstudio")) {
+ sso_check(object)
+ message("\nLaunching ShinyStan interface... ",
+ "for large models this may take some time.")
+ invisible(launch(object, rstudio, ...))
}
- if (!is.shinystan(object))
- stop("'object' is not a valid input. See help('launch_shinystan').")
-
- message("\nLaunching ShinyStan interface... ",
- "for large models this may take some time.")
- invisible(launch(object, rstudio, ...))
-}
-#' ShinyStan demo
+#' 'ShinyStan' demo
#'
#' @aliases eight_schools
#' @export
@@ -102,8 +118,8 @@ launch_shinystan <- function(object,
#' the only option, but additional demos may be available in future releases.
#' \describe{
#' \item{\code{eight_schools}}{Hierarchical meta-analysis model. See
-#' \emph{Meta Analysis} chapter of the Stan manual (chapter 11.2 in version
-#' 2.9), \url{http://mc-stan.org/documentation/}.}
+#' \emph{Meta Analysis} chapter of the 'Stan' manual
+#' \url{http://mc-stan.org/users/documentation/}.}
#' }
#' @return An S4 shinystan object.
#'
diff --git a/R/retrieve.R b/R/retrieve.R
index 98319a70..219f4871 100644
--- a/R/retrieve.R
+++ b/R/retrieve.R
@@ -25,15 +25,15 @@
#' include/exclude warmup iterations (the default is \code{FALSE}). See
#' Details, below.
#'
-#' @details The argument \code{what} can take on the values below. Args:
-#' \code{arg} means that \code{arg} can be specified in \code{...} for this
+#' @details The argument \code{what} can take on the values below. 'Args:
+#' \code{arg}' means that \code{arg} can be specified in \code{...} for this
#' value of \code{what}.
#' \describe{
#' \item{\code{"rhat"}, \code{"Rhat"}, \code{"r_hat"}, or \code{"R_hat"}}{returns: Rhat statistics. Args: \code{pars}}
#' \item{\code{"N_eff"}, \code{"n_eff"}, \code{"neff"}, \code{"Neff"}, \code{"ess"}, or \code{"ESS"}}{returns: Effective sample sizes. Args: \code{pars}}
#' \item{\code{"mean"}}{returns: Posterior means. Args: \code{pars}}
#' \item{\code{"sd"}}{returns: Posterior standard deviations. Args: \code{pars}}
-#' \item{\code{"se_mean"} or \code{"mcse"}}{returns: Monte carlo standard error. Args: \code{pars}}
+#' \item{\code{"se_mean"} or \code{"mcse"}}{returns: Monte Carlo standard error. Args: \code{pars}}
#' \item{\code{"median"}}{returns: Posterior medians. Args: \code{pars}.}
#' \item{\code{"quantiles"} or any string with \code{"quant"} in it (not case sensitive)}{returns: 2.5\%, 25\%, 50\%, 75\%, 97.5\% posterior quantiles. Args: \code{pars}.}
#' \item{\code{"avg_accept_stat"} or any string with \code{"accept"} in it (not case sensitive)}{returns: Average value of "accept_stat" (which itself is the average acceptance probability over the NUTS subtree). Args: \code{inc_warmup}}
diff --git a/R/shinystan-objects.R b/R/shinystan-objects.R
index 1243688c..95373307 100644
--- a/R/shinystan-objects.R
+++ b/R/shinystan-objects.R
@@ -12,11 +12,12 @@
# shinystan class definition ------------------------------------------
-#' S4 shinystan objects
+#' S4 \code{shinystan} objects
#'
#' @aliases shinystan-class
-#' @description See \code{\link{as.shinystan}} for documentation on creating
-#' shinystan objects and \code{\link{eight_schools}} for an example object.
+#' @description See \code{\link{as.shinystan}} for documentation on creating
+#' \code{shinystan} objects and \code{\link{eight_schools}} for an example
+#' object.
#'
#' @slot model_name (\code{"character"}) Model name.
#' @slot param_names (\code{"character"}) Parameter names.
@@ -28,17 +29,17 @@
#' @slot n_chain (\code{"integer"}) Number of chains.
#' @slot n_iter (\code{"integer"}) Number of iterations per chain.
#' @slot n_warmup (\code{"integer"}) Number of warmup iterations per chain.
-#' @slot user_model_info (\code{"character"}) Notes to display on ShinyStan's
-#' \strong{Notepad} page.
-#' @slot model_code (\code{"character"}) Model code to display on ShinyStan's
-#' \strong{Model Code} page.
+#' @slot user_model_info (\code{"character"}) Notes to display on the
+#' \strong{Notepad} page in the 'ShinyStan' GUI.
+#' @slot model_code (\code{"character"}) Model code to display on the
+#' \strong{Model Code} page in the 'ShinyStan' GUI.
#' @slot misc (\code{"list"}) Miscellaneous, for internal use.
#'
#' @template seealso-as.shinystan
#' @template seealso-drop_parameters
#' @template seealso-generate_quantity
#' @seealso \code{\link{shinystan-metadata}} to view or change metadata
-#' associated with a shinystan object.
+#' associated with a \code{shinystan} object.
#'
shinystan <- setClass(
Class = "shinystan",
@@ -77,30 +78,31 @@ shinystan <- setClass(
# create shinystan objects ------------------------------------------------
# as.shinystan (generic) --------------------------------------------------
-#' Create and test shinystan objects
+#' Create and test \code{shinystan} objects
#'
-#' @description The \code{as.shinystan} function creates shinystan objects that
-#' can be used with \code{\link{launch_shinystan}} and various other functions
-#' in the \pkg{shinystan} package. \code{as.shinystan} is a generic for which
-#' the \pkg{shinystan} package provides several methods. Currently methods are
-#' provided for creating shinystan objects from arrays, lists of matrices,
-#' stanfit objects (\pkg{rstan}), stanreg objects (\pkg{rstanarm}), and
-#' mcmc.list objects (\pkg{coda}).
+#' @description The \code{as.shinystan} function creates \code{shinystan}
+#' objects that can be used with \code{\link{launch_shinystan}} and various
+#' other functions in the \pkg{shinystan} package. \code{as.shinystan} is a
+#' generic for which the \pkg{shinystan} package provides several methods.
+#' Currently methods are provided for creating \code{shinystan} objects from
+#' arrays, lists of matrices, \code{stanfit} objects (\pkg{rstan}),
+#' \code{stanreg} objects (\pkg{rstanarm}), and \code{mcmc.list} objects
+#' (\pkg{coda}).
#'
-#' \code{is.shinystan} tests if an object is a shinystan object.
+#' \code{is.shinystan} tests if an object is a \code{shinystan} object.
#'
#' @name as.shinystan
#' @export
-#' @param X For \code{as.shinystan}, an object to be converted to a shinystan
-#' object. See the Methods section below. For \code{is.shinystan}, an object
-#' to check.
+#' @param X For \code{as.shinystan}, an object to be converted to a
+#' \code{shinystan} object. See the Methods section below. For
+#' \code{is.shinystan}, an object to check.
#' @param ... Arguments passed to the individual methods.
#'
-#' @return \code{as.shinystan} returns a shinystan object, which is an instance
-#' of S4 class \code{"shinystan"}.
+#' @return \code{as.shinystan} returns a \code{shinystan} object, which is an
+#' instance of S4 class \code{"shinystan"}.
#'
-#' \code{is.shinystan} returns \code{TRUE} if the tested object is a shinystan
-#' object and \code{FALSE} otherwise.
+#' \code{is.shinystan} returns \code{TRUE} if the tested object is a
+#' \code{shinystan} object and \code{FALSE} otherwise.
#'
#' @template seealso-launch
#' @template seealso-drop_parameters
@@ -117,7 +119,7 @@ setGeneric("as.shinystan", function(X, ...) {
is.shinystan <- function(X) inherits(X, "shinystan")
# as.shinystan (array) ---------------------------------------------------
-#' @describeIn as.shinystan Create a shinystan object from a 3-D
+#' @describeIn as.shinystan Create a \code{shinystan} object from a 3-D
#' \code{\link{array}} of simulations. The array should have dimensions
#' corresponding to iterations, chains, and parameters, in that order.
#'
@@ -137,8 +139,9 @@ is.shinystan <- function(X) inherits(X, "shinystan")
#' Code} tab. For \code{stanfit} (\pkg{rstan}) and \code{stanreg}
#' (\pkg{rstanarm}) objects the model code is automatically retrieved from the
#' object.
-#' @param note Optionally, text to display on ShinyStan's notes page (stored in
-#' \code{user_model_info} slot).
+#' @param note Optionally, text to display on the \strong{Notepad} page in the
+#' 'ShinyStan' GUI (stored in \code{user_model_info} slot of the
+#' \code{shinystan} object).
#' @param sampler_params,algorithm,max_treedepth Rarely used and never
#' necessary. If using the \code{as.shinystan} method for arrays or lists,
#' these arguments can be used to manually provide information that is
@@ -309,11 +312,11 @@ setMethod(
# as.shinystan (list) ---------------------------------------------------
-#' @describeIn as.shinystan Create a shinystan object from a \code{\link{list}}
-#' of matrices. Each \code{\link{matrix}} (or 2-D array) should contain the
-#' simulations for an individual chain and all of the matrices should have the
-#' same number of iterations (rows) and parameters (columns). Parameters
-#' should have the same names and be in the same order.
+#' @describeIn as.shinystan Create a \code{shinystan} object from a
+#' \code{\link{list}} of matrices. Each \code{\link{matrix}} (or 2-D array)
+#' should contain the simulations for an individual chain and all of the
+#' matrices should have the same number of iterations (rows) and parameters
+#' (columns). Parameters should have the same names and be in the same order.
#'
#' @examples
#' \dontrun{
@@ -418,8 +421,8 @@ setMethod(
# as.shinystan (mcmc.list) -----------------------------------------------
setOldClass("mcmc.list")
-#' @describeIn as.shinystan Create a shinystan object from an mcmc.list
-#' (\pkg{coda}).
+#' @describeIn as.shinystan Create a \code{shinystan} object from an
+#' \code{mcmc.list} object (\pkg{coda}).
#'
setMethod(
"as.shinystan",
@@ -505,13 +508,14 @@ setMethod(
# as.shinystan (stanfit) -------------------------------------------------
setClass("stanfit", getClass("stanfit", where = getNamespace("rstan")))
-#' @describeIn as.shinystan Create a shinystan object from a stanfit object
-#' (\pkg{\link[rstan]{rstan}}). Fewer optional arguments are available for
-#' this method because all important information can be taken automatically
-#' from the stanfit object.
+#' @describeIn as.shinystan Create a \code{shinystan} object from a
+#' \code{stanfit} object (\pkg{\link[rstan]{rstan}}). Fewer optional arguments
+#' are available for this method because all important information can be
+#' taken automatically from the \code{stanfit} object.
#'
-#' @param pars For stanfit objects (\pkg{rstan}), an optional character vector
-#' specifying which parameters should be included in the shinystan object.
+#' @param pars For stanfit objects (\pkg{rstan}), an optional character vector
+#' specifying which parameters should be included in the \code{shinystan}
+#' object.
#'
#' @examples
#' \dontrun{
@@ -698,16 +702,16 @@ setMethod(
# as.shinystan (stanreg) -------------------------------------------------
setOldClass("stanreg")
-#' @describeIn as.shinystan Create a shinystan object from a stanreg object
-#' (\pkg{\link[rstanarm]{rstanarm}}).
+#' @describeIn as.shinystan Create a \code{shinystan} object from a
+#' \code{stanreg} object (\pkg{\link[rstanarm]{rstanarm}}).
#'
-#' @param ppd For stanreg objects (\pkg{rstanarm}), \code{ppd}
+#' @param ppd For \code{stanreg} objects (\pkg{rstanarm}), \code{ppd}
#' (logical) indicates whether to draw from the posterior predictive
-#' distribution before launching ShinyStan. The default is \code{TRUE},
+#' distribution before launching the app. The default is \code{TRUE},
#' although for very large objects it can be convenient to set it to
#' \code{FALSE} as drawing from the posterior predictive distribution can be
#' time consuming. If \code{ppd} is \code{TRUE} then graphical posterior
-#' predictive checks are available when ShinyStan is launched.
+#' predictive checks are available when 'ShinyStan' is launched.
#' @param seed Passed to \code{\link[rstanarm]{pp_check}} (\pkg{rstanarm}) if
#' \code{ppd} is \code{TRUE}.
#'
diff --git a/R/shinystan-package.R b/R/shinystan-package.R
index aa257a6a..7c25b224 100644
--- a/R/shinystan-package.R
+++ b/R/shinystan-package.R
@@ -11,7 +11,7 @@
# this program; if not, see .
-#' ShinyStan interface and shinystan R package
+#' 'ShinyStan' interface and \code{shinystan} R package
#'
#' @docType package
#' @name shinystan-package
@@ -22,24 +22,24 @@
#' \emph{Stan Development Team}
#' }
#'
-#' Applied Bayesian data analysis is primarily implemented through the Markov
-#' chain Monte Carlo (MCMC) algorithms offered by various software packages.
-#' When analyzing a posterior sample obtained by one of these algorithms the
+#' Applied Bayesian data analysis is primarily implemented through the Markov
+#' chain Monte Carlo (MCMC) algorithms offered by various software packages.
+#' When analyzing a posterior sample obtained by one of these algorithms the
#' first step is to check for signs that the chains have converged to the target
-#' distribution and and also for signs that the algorithm might require tuning
-#' or might be ill-suited for the given model. There may also be theoretical
-#' problems or practical inefficiencies with the specification of the model.
-#' ShinyStan provides interactive plots and tables helpful for analyzing a
+#' distribution and and also for signs that the algorithm might require tuning
+#' or might be ill-suited for the given model. There may also be theoretical
+#' problems or practical inefficiencies with the specification of the model. The
+#' 'ShinyStan' app provides interactive plots and tables helpful for analyzing a
#' posterior sample, with particular attention to identifying potential problems
#' with the performance of the MCMC algorithm or the specification of the model.
-#' ShinyStan is powered by RStudio's Shiny web application framework and works
-#' with the output of MCMC programs written in any programming language (and has
-#' extended functionality for models fit using the rstan package and the
-#' No-U-Turn sampler).
+#' 'ShinyStan' is powered by the 'Shiny' web application framework by 'RStudio'
+#' and works with the output of MCMC programs written in any programming
+#' language (and has extended functionality for models fit using the \pkg{rstan}
+#' package and the No-U-Turn sampler).
#'
-#' @section ShinyStan has extended functionality for Stan models:
+#' @section 'ShinyStan' has extended functionality for 'Stan' models:
#'
-#' Stan (\url{http://mc-stan.org}) models can be run in R using the
+#' 'Stan' (\url{http://mc-stan.org}) models can be run in \R using the
#' \pkg{\link[rstan]{rstan}} and \pkg{\link[rstanarm]{rstanarm}} packages.
#'
#' @section Saving and sharing:
@@ -47,14 +47,14 @@
#' The \pkg{shinystan} package allows you to store the basic components of an
#' entire project (code, posterior samples, graphs, tables, notes) in a single
#' object, a \code{\link[=as.shinystan]{shinystan object}} (sso, for short).
-#' Users can save many of the plots as ggplot2 objects for further
+#' Users can save many of the plots as \pkg{ggplot2} objects for further
#' customization and easy integration in reports or post-processing for
#' publication.
#'
#' The \code{\link{deploy_shinystan}} function lets you easily deploy your own
-#' ShinyStan apps online for any of your models using RStudio's shinyapps.io
-#' service. Each of your apps (each of your models) will have a unique url and
-#' will be compatible with Safari, Firefox, Chrome, and most other browsers.
+#' 'ShinyStan' apps online for any of your models using the shinyapps.io
+#' service from 'RStudio'. Each of your apps (each of your models) will have a
+#' unique url and will be compatible with most web browsers.
#'
#' @section License:
#'
@@ -68,8 +68,8 @@
#'
#' @section Help and bug reports:
#' \itemize{
-#' \item Stan Users Google group (\url{https://groups.google.com/forum/#!forum/stan-users})
-#' \item ShinyStan issue tracker (\url{https://github.com/stan-dev/shinystan/issues})
+#' \item 'Stan' forums (\url{http://discourse.mc-stan.org})
+#' \item 'ShinyStan' issue tracker (\url{https://github.com/stan-dev/shinystan/issues})
#' }
#'
#' @template seealso-as.shinystan
diff --git a/R/sso-metadata.R b/R/sso-metadata.R
index 051bb009..ff703f87 100644
--- a/R/sso-metadata.R
+++ b/R/sso-metadata.R
@@ -11,7 +11,7 @@
# this program; if not, see .
-#' View or change metadata associated with a shinystan object
+#' View or change metadata associated with a \code{shinystan} object
#'
#' @name shinystan-metadata
#' @template args-sso
@@ -72,13 +72,14 @@ sso_info <- function(sso) {
#' used as an argument to \code{\link{cat}}. See \strong{Examples}.
#'
#' @return \code{model_code} returns or replaces model code stored in a
-#' shinystan object. If \code{code} is \code{NULL} then any existing model
-#' code stored in \code{sso} is returned as a character string. If \code{code}
-#' is specified then an updated shinystan object is returned with \code{code}
-#' added. For shinystan objects created from stanfit (\pkg{rstan}) and stanreg
-#' (\pkg{rstanarm}) objects, model code is automatically taken from that
-#' object and does not need to be added manually. From within the ShinyStan
-#' interface model code can be viewed on the \strong{Model Code} page.
+#' \code{shinystan} object. If \code{code} is \code{NULL} then any existing
+#' model code stored in \code{sso} is returned as a character string. If
+#' \code{code} is specified then an updated \code{shinystan} object is
+#' returned with \code{code} added. For \code{shinystan} objects created from
+#' stanfit (\pkg{rstan}) and stanreg (\pkg{rstanarm}) objects, model code is
+#' automatically taken from that object and does not need to be added
+#' manually. From within the 'ShinyStan' interface model code can be viewed on
+#' the \strong{Model Code} page.
#'
#' @examples
#' ##################
@@ -142,13 +143,14 @@ validate_model_code <- function(code) {
#' if \code{note} is specified then its content is appended to the existing
#' notes.
#'
-#' @return \code{notes} returns, amends, or replaces notes stored in a shinystan
-#' object. If \code{note} is \code{NULL} then any existing notes stored in
-#' \code{sso} are returned as a character string. If \code{note} is specified
-#' then an updated shinystan object is returned with either \code{note} added
-#' to the previous notes (if \code{replace=FALSE}) or overwritten by
-#' \code{note} (if \code{replace = TRUE}). From within the ShinyStan
-#' interface, notes are viewable on the \strong{Notepad} page.
+#' @return \code{notes} returns, amends, or replaces notes stored in a
+#' \code{shinystan} object. If \code{note} is \code{NULL} then any existing
+#' notes stored in \code{sso} are returned as a character string. If
+#' \code{note} is specified then an updated \code{shinystan} object is
+#' returned with either \code{note} added to the previous notes (if
+#' \code{replace=FALSE}) or overwritten by \code{note} (if \code{replace =
+#' TRUE}). From within the 'ShinyStan' interface, notes are viewable on the
+#' \strong{Notepad} page.
#'
#' @examples
#' #############
@@ -196,9 +198,9 @@ notes <- function(sso, note = NULL, replace = FALSE) {
#' @param name A string giving the new model name to use.
#'
#' @return \code{model_name} returns or replaces the model name associated with
-#' a shinystan object. If \code{name} is \code{NULL} then the current model
-#' name is returned. If \code{name} is specified then \code{sso} is returned
-#' with an updated model name.
+#' a \code{shinystan} object. If \code{name} is \code{NULL} then the current
+#' model name is returned. If \code{name} is specified then \code{sso} is
+#' returned with an updated model name.
#'
#' @examples
#' ##################
diff --git a/README.md b/README.md
index c1f9eca4..eeb86e5e 100644
--- a/README.md
+++ b/README.md
@@ -44,9 +44,8 @@ launch_shinystan_demo()
### Screenshots
-
-----
-![](https://github.com/stan-dev/shinystan/blob/develop/images/explore.png)
+![](https://github.com/stan-dev/shinystan/blob/develop/images/home.png)
![](https://github.com/stan-dev/shinystan/blob/develop/images/explore.png)
+
### About ShinyStan
Applied Bayesian data analysis is primarily implemented through the MCMC
diff --git a/data/eight_schools.rda b/data/eight_schools.rda
index 6373a466..7c5353c6 100644
Binary files a/data/eight_schools.rda and b/data/eight_schools.rda differ
diff --git a/inst/CITATION b/inst/CITATION
index 4bdc6470..319a819f 100644
--- a/inst/CITATION
+++ b/inst/CITATION
@@ -4,10 +4,10 @@ citEntry(entry = "Misc",
title = "shinystan: Interactive Visual and Numerical Diagnostics and Posterior Analysis for Bayesian Models.",
author = person(given = "Stan Development Team"),
year = "2017",
- note = "R package version 2.3.0",
+ note = "R package version 2.4.0",
url = "http://mc-stan.org/",
textVersion =
paste("Stan Development Team (2017).",
- title = "shinystan: Interactive Visual and Numerical Diagnostics and Posterior Analysis for {Bayesian} Models. R package version 2.3.0.",
+ title = "shinystan: Interactive Visual and Numerical Diagnostics and Posterior Analysis for {Bayesian} Models. R package version 2.4.0.",
"http://mc-stan.org/.")
)
diff --git a/inst/ShinyStan/helper_functions/hmc_diagnostics_helpers.R b/inst/ShinyStan/helper_functions/hmc_diagnostics_helpers.R
index 0feb03a8..7a08f43b 100644
--- a/inst/ShinyStan/helper_functions/hmc_diagnostics_helpers.R
+++ b/inst/ShinyStan/helper_functions/hmc_diagnostics_helpers.R
@@ -203,7 +203,6 @@ thm_no_yaxs <- thm + no_yaxs
retainDateWindow = TRUE) %>%
dygraphs::dyAxis("x", pixelsPerLabel = 1e7, axisLineWidth = 3) %>%
dygraphs::dyAxis("y", pixelsPerLabel = 30, axisLabelWidth = 30) %>%
- dygraphs::dyRangeSelector(height = 1, retainDateWindow = TRUE) %>%
dygraphs::dyLegend(show = "never") %>%
dygraphs::dyHighlight(highlightCircleSize = 2,
highlightSeriesBackgroundAlpha = 1/3,
diff --git a/inst/ShinyStan/helper_functions/shinystan_helpers.R b/inst/ShinyStan/helper_functions/shinystan_helpers.R
index 3de549e5..5f7ea413 100644
--- a/inst/ShinyStan/helper_functions/shinystan_helpers.R
+++ b/inst/ShinyStan/helper_functions/shinystan_helpers.R
@@ -1,13 +1,13 @@
# param_trace_multi ------------------------------------------------------
# trace plots for multiple parameters
-.param_trace_multi <- function(params = NULL, all_param_names, dat,
+.param_trace_multi <- function(params = NULL, all_param_names, dat,
warmup_val = 0,
chain = 0, palette = "Default",
- rect = "Samples", rect_color = "skyblue",
+ rect = "Samples", rect_color = "skyblue",
rect_alpha = 0.1,
layout = "Long", x1, x2) {
-
+
params <- .update_params_with_groups(params, all_param_names)
if(length(params) == 0) {
params <- dimnames(dat)$parameters[1:min(4, dim(dat)[3])]
@@ -19,7 +19,7 @@
dat$chains <- "chain:1"
}
dat$iterations <- x1:x2
- if (chain != 0)
+ if (chain != 0)
dat <- subset(dat, chains == paste0("chain:",chain))
rect_xmin <- ifelse(rect == "Samples", Inf, -Inf)
shading_rect <- annotate("rect", xmin = rect_xmin, xmax = warmup_val,
@@ -35,14 +35,14 @@
if(palette == "Rainbow") clrs <- scale_colour_manual(name = lgnd_title, values = rainbow(nclrs))
lgnd_txt <- theme(legend.text = element_text(size = 13, face = "bold"))
-
+
graph <- ggplot(dat, aes(x = iterations, y = value, color = chains))
graph <- graph + xy_labs + clrs + theme_classic() %+replace% (axis_color + axis_labs + fat_axis + h_lines + lgnd_top + lgnd_txt + strip_txt + transparent)
if (rect != "None") graph <- graph + shading_rect
graph <- graph + geom_line(size = 0.35) + scale_x_continuous(limits = c(x1, x2))
if (layout == "Grid") {
- graph <- graph + facet_wrap(~ parameters, scales = "free_y")
+ graph <- graph + facet_wrap(~ parameters, scales = "free_y")
} else {
graph <- graph + facet_grid(parameters ~., scales = "free_y")
}
@@ -57,33 +57,33 @@
transform_x = "identity",
fill_color = "gray20", line_color = "gray35",
title = TRUE) {
-
+
ttl <- "Histogram of Posterior Draws \n"
if (transform_x != "identity") {
t_x <- get(transform_x)
dat <- apply(dat, 2, t_x)
}
- x_lab <- if (transform_x != "identity")
+ x_lab <- if (transform_x != "identity")
paste0(transform_x, "(", param, ")") else param
-
+
dat <- reshape2::melt(dat)
if (!("chains" %in% colnames(dat))) { # fixes for if there's only 1 chain:
dat$chains <- "chain:1"
dat$iterations <- 1:nrow(dat)
}
if (chain != 0) dat <- subset(dat, chains == paste0("chain:",chain))
-
+
graph <- ggplot(dat, aes(x = value))
if (binwd == 0) {
graph <- graph + geom_histogram(fill = fill_color, color = line_color, size = 0.2)
} else {
- graph <- graph + geom_histogram(fill = fill_color, color = line_color,
+ graph <- graph + geom_histogram(fill = fill_color, color = line_color,
binwidth = binwd, size = 0.2)
}
graph <- graph +
labs(x = x_lab, y = "") +
- theme_classic() %+replace%
+ theme_classic() %+replace%
(title_txt + axis_color + axis_labs + fat_axis + no_yaxs + transparent)
if (title == TRUE) graph <- graph + ggtitle(ttl)
@@ -95,9 +95,9 @@
# density plot for a single parameter
# data.frame of prior families and function names
-priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
+priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
"Gamma", "Inverse Gamma"),
- fun = c("dnorm", ".dt_loc_scale", "dcauchy", "dbeta",
+ fun = c("dnorm", ".dt_loc_scale", "dcauchy", "dbeta",
"dexp", "dgamma", ".dinversegamma"))
.param_dens <- function(param, dat, chain,
@@ -109,58 +109,58 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
title = TRUE,
transform_x = "identity",
prior_fam = "None", prior_params) {
-
+
ttl <- "Kernel Density Estimate \n"
if (transform_x != "identity") {
t_x <- get(transform_x)
dat <- apply(dat, 2, t_x)
}
- x_lab <- if (transform_x != "identity")
+ x_lab <- if (transform_x != "identity")
paste0(transform_x, "(", param, ")") else param
-
+
dat <- reshape2::melt(dat)
if (!("chains" %in% colnames(dat))) { # fixes for if there's only 1 chain:
dat$chains <- "chain:1"
dat$iterations <- 1:nrow(dat)
}
- if (chain != 0)
+ if (chain != 0)
dat <- subset(dat, chains == paste0("chain:",chain))
-
+
Mean <- mean(dat$value)
Median <- median(dat$value)
dens_dat <- with(density(dat$value), data.frame(x,y))
MAP <- with(dens_dat, x[which.max(y)])
-
+
fclr <- ifelse(is.null(fill_color), "black", fill_color)
lclr <- ifelse(is.null(line_color), "lightgray", line_color)
-
+
many_breaks <- function(x) pretty(x, n = 15)
too_many_breaks <- function(x) pretty(x, n = 35)
if(x_breaks == "None") x_scale <- scale_x_continuous(breaks = NULL)
if(x_breaks == "Some") x_scale <- scale_x_continuous()
if(x_breaks == "Many") x_scale <- scale_x_continuous(breaks = many_breaks)
-
+
if (chain == 0 & chain_split == TRUE) {
graph <- ggplot(dat, aes(x = value, color = chains, fill = chains))
if (prior_fam != "None") {
- graph <- graph + stat_function(alpha=0.75,color = "black", fun = as.character(priors$fun[priors$family==prior_fam]), args = prior_params, show_guides = TRUE)
+ graph <- graph + stat_function(alpha=0.75,color = "black", fun = as.character(priors$fun[priors$family==prior_fam]), args = prior_params, show_guides = TRUE)
}
graph <- graph +
geom_density(alpha = 0.15) +
- scale_color_discrete("") +
+ scale_color_discrete("") +
scale_fill_discrete("") +
labs(x = x_lab, y = "") +
x_scale + # y_scale +
- theme_classic() %+replace% (title_txt + axis_color + axis_labs + fat_axis + no_yaxs + transparent)
-
+ theme_classic() %+replace% (title_txt + axis_color + axis_labs + fat_axis + no_yaxs + transparent)
+
if (title == TRUE) graph <- graph + ggtitle(ttl)
return(graph)
}
-
+
graph <- ggplot(dens_dat, aes(x = x, ymax = y))
if (prior_fam != "None") {
- graph <- graph +
- stat_function(fun = as.character(priors$fun[priors$family==prior_fam]),
+ graph <- graph +
+ stat_function(fun = as.character(priors$fun[priors$family==prior_fam]),
args = prior_params)
}
graph <- graph +
@@ -169,7 +169,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
labs(x = x_lab, y = "") +
geom_ribbon(ymin = 0, fill = fclr, color = lclr, alpha = if (prior_fam == "None") 1 else 0.85) +
theme_classic() %+replace% (title_txt + axis_color + axis_labs + fat_axis + no_yaxs + transparent)
-
+
if (title == TRUE) graph <- graph + ggtitle(ttl)
if (point_est != "None") {
graph <- graph + annotate("segment",
@@ -193,14 +193,14 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
.ac_fun <- function(x, lag.max, partial = FALSE) {
if (!partial)
acf(x, lag.max = lag.max, plot = FALSE)$acf[,, 1L]
- else
+ else
pacf(x, lag.max = lag.max, plot = FALSE)$acf[,, 1L]
}
.ac_plot_data <- function(dat, lags, partial = FALSE) {
nc <- length(unique(dat$chains))
ac_list <- tapply(dat$value, INDEX = dat$chains, FUN = .ac_fun, lag.max = lags,
partial = partial, simplify = FALSE)
- nl <- if (partial) lags else lags + 1
+ nl <- if (partial) lags else lags + 1
ch <- factor(rep(1:nc, each = nl), labels = paste0("chain:", 1:nc))
ll <- rep(seq(if (partial) 1 else 0, lags), nc)
data.frame(chains = ch, ac = do.call("c", args = ac_list), lag = ll)
@@ -208,10 +208,10 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
.ac_plot_data_multi <- function(dat, lags, partial = FALSE) {
nc <- length(unique(dat$chains))
np <- length(unique(dat$parameters))
- ac_list <- tapply(dat$value, INDEX = list(dat$chains, dat$parameters),
- FUN = .ac_fun, lag.max = lags,
+ ac_list <- tapply(dat$value, INDEX = list(dat$chains, dat$parameters),
+ FUN = .ac_fun, lag.max = lags,
partial = partial, simplify = FALSE)
- nl <- if (partial) lags else lags + 1
+ nl <- if (partial) lags else lags + 1
ch <- factor(rep(rep(1:nc, each = nl), np), labels = paste0("chain:", 1:nc))
ll <- rep(seq(if (partial) 1 else 0, lags), nc * np)
pp <- factor(rep(1:np, each = nc * nl), labels = levels(dat$parameters))
@@ -227,9 +227,9 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
}
ac_dat <- .ac_plot_data(dat, lags)
ac_labs <- labs(x = "Lag", y = "Autocorrelation")
- ac_theme <- theme_classic() %+replace%
+ ac_theme <- theme_classic() %+replace%
(axis_color + axis_labs + fat_axis + no_lgnd + transparent)
- y_scale <- scale_y_continuous(breaks = seq(0, 1, 0.25),
+ y_scale <- scale_y_continuous(breaks = seq(0, 1, 0.25),
labels = c("0","","0.5","",""))
graph <- ggplot(ac_dat, aes(x = lag, y = ac))
graph <- graph +
@@ -242,7 +242,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
.autocorr_plot <- function(samps, partial = FALSE,
lags = 25, flip = FALSE,
combine_chains = FALSE) {
-
+
params <- dimnames(samps)$parameters
nParams <- length(params)
nChains <- dim(samps)[2L]
@@ -254,28 +254,28 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
ac_type <- if (partial) "partial" else "correlation"
if (nParams == 1) ac_dat <- .ac_plot_data(dat, lags = lags, partial = partial)
else ac_dat <- .ac_plot_data_multi(dat, lags = lags, partial = partial)
-
- ac_labs <- labs(x = "Lag", y = if (partial)
+
+ ac_labs <- labs(x = "Lag", y = if (partial)
"Partial autocorrelation" else "Autocorrelation")
- ac_theme <- theme_classic() %+replace%
+ ac_theme <- theme_classic() %+replace%
(axis_color + axis_labs + fat_axis + no_lgnd + strip_txt + transparent)
- y_scale <- scale_y_continuous(breaks = seq(0, 1, 0.25),
+ y_scale <- scale_y_continuous(breaks = seq(0, 1, 0.25),
labels = c("0","","0.5","",""))
title_theme <- theme(plot.title = element_text(face = "bold", size = 18))
if (combine_chains) {
graph <- ggplot(ac_dat, aes(x= lag, y = ac))
graph <- graph +
- geom_bar(position = "identity", stat = "identity",
+ geom_bar(position = "identity", stat = "identity",
fill = base_fill, size = 0.4) +
- y_scale +
- ac_labs +
+ y_scale +
+ ac_labs +
ac_theme
-
+
if (nParams == 1) return(graph + ggtitle(paste(params, "\n")) + title_theme)
else return(graph + facet_wrap(~parameters))
}
-
- graph <- ggplot(ac_dat, aes(x = lag, y = ac, color = factor(chains),
+
+ graph <- ggplot(ac_dat, aes(x = lag, y = ac, color = factor(chains),
fill = factor(chains)))
graph <- graph +
geom_bar(position = "identity", stat = "identity", size = 0.4) +
@@ -284,16 +284,16 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
y_scale +
ac_labs +
ac_theme
-
+
if (nParams == 1) {
- graph <- graph +
+ graph <- graph +
facet_wrap(~chains) + ggtitle(paste(params, "\n")) + title_theme
return(graph)
} else { # nParams > 1
-
+
while(is.null(flip)) return()
-
- graph <- graph +
+
+ graph <- graph +
if (flip) facet_grid(chains ~ parameters) else facet_grid(parameters ~ chains)
return(graph)
}
@@ -306,9 +306,9 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
# multiparam_plot --------------------------------------------------
# main plot of multiple parameters
.multiparam_plot <- function(samps, params = NULL, all_param_names,
- show_density, show_ci_line, CI.level = 0.5,
- show.level = 0.95, point_est, rhat_values,
- color_by_rhat, rhat_palette, fill_color,
+ show_density, show_ci_line, CI.level = 0.5,
+ show.level = 0.95, point_est, rhat_values,
+ color_by_rhat, rhat_palette, fill_color,
outline_color, est_color) {
# params <- .update_params_with_regex(params, all_param_names)
@@ -322,7 +322,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
}
}
params <- unique(params)
-
+
Blues <- c("#C6DBEF", "#4292C6", "#08306B")
Grays <- c("#D9D9D9", "#737373", "#000000")
Greens <- c("#C7E9C0", "#41AB5D", "#00441B")
@@ -330,9 +330,9 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
Purples <- c("#DADAEB", "#807DBA", "#3F007D")
Reds <- c("#FCBBA1", "#EF3B2C", "#67000D")
rhat_pal <- get(rhat_palette)
- rhat_id <- ifelse(rhat_values < 1.05, "A",
+ rhat_id <- ifelse(rhat_values < 1.05, "A",
ifelse(rhat_values < 1.1, "B", "C"))
- rhat_id <- factor(rhat_id[params], levels = c("A","B", "C"),
+ rhat_id <- factor(rhat_id[params], levels = c("A","B", "C"),
labels = c("<1.05", "<1.1", ">1.1"))
rhat_colors <- scale_color_manual(name = bquote(hat(R)),
values = rhat_pal,
@@ -423,7 +423,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
#point estimator
if (color_by_rhat) {
- p.point <- geom_segment(aes(x = m, xend = m, y = y, yend = y + 0.25,
+ p.point <- geom_segment(aes(x = m, xend = m, y = y, yend = y + 0.25,
color = rhat_id), size = 1.5)
p.all + p.poly + p.den + p.col + p.point + rhat_colors + rhat_lgnd
} else {
@@ -441,7 +441,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
shape = 21, size = 4)
p.all + p.ci.2 + p.point + rhat_colors + rhat_lgnd
} else {
- p.point <- geom_point(aes(x = m, y = y), size = 4, color = fill_color,
+ p.point <- geom_point(aes(x = m, y = y), size = 4, color = fill_color,
fill = est_color, shape = 21)
p.all + p.ci.2 + p.point
}
@@ -452,24 +452,24 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
# histogram of rhat, n_eff/N or mcse/sd -----------------------------------
.rhat_neff_mcse_hist <- function(dat, which, N) {
# samps: post-warmup samples
- xlab <- switch(which,
+ xlab <- switch(which,
rhat = "Rhat statistic",
n_eff = "Effective sample size / iterations",
mcse = "Monte Carlo se / posterior sd"
)
my_labs <- labs(y = "", x = xlab)
base_fill
- graph <- qplot(x = x, data = dat, color = I(vline_base_clr),
+ graph <- qplot(x = x, data = dat, color = I(vline_base_clr),
fill = I(base_fill), size = I(0.2))
- graph <- graph +
- my_labs +
+ graph <- graph +
+ my_labs +
theme_classic() %+replace% (axis_color + axis_labs + fat_axis + no_yaxs + transparent)
graph
}
# n_eff_warnings -----------------------------------------------------------
-.n_eff_warnings <- function(summary, threshold = 10,
+.n_eff_warnings <- function(summary, threshold = 10,
N_total = NULL) {
n_eff <- summary[,"n_eff"]
warn_params <- names(which(n_eff / N_total < threshold / 100))
@@ -499,10 +499,11 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
# dynamic trace plot ------------------------------------------------------
-.param_trace_dynamic <- function(param_samps, param_name=NULL, chain,
+.param_trace_dynamic <- function(param_samps, chain,
warmup_val, warmup_shade = TRUE,
- stack = FALSE, grid = FALSE) {
-
+ stack = FALSE, grid = FALSE,
+ x_lab = NULL, y_lab = NULL) {
+
dim_samps <- dim(param_samps)
if (is.null(dim_samps)) nChains <- 1
else nChains <- dim_samps[2]
@@ -522,20 +523,17 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
}
`%>%` <- dygraphs::`%>%`
- shade_to <- if (warmup_shade)
+ shade_to <- if (warmup_shade)
paste0(warmup_val,"-01-01") else "0001-01-01"
- y_axis_label_remove <- if (stack)
+ y_axis_label_remove <- if (stack)
"white" else NULL
- clrs <- color_vector(nChains)
+ clrs <- color_vector(nChains)
if (chain != 0) clrs <- clrs[chain]
- dygraphs::dygraph(param_chains, xlab = "", ylab = "") %>%
+ dygraphs::dygraph(param_chains, xlab = x_lab, ylab = y_lab) %>%
dygraphs::dyAxis("y", axisLabelColor = y_axis_label_remove) %>%
- dygraphs::dyAxis("x", axisLabelColor = "white") %>%
- dygraphs::dyOptions(colors = clrs, stackedGraph = stack, drawGrid = grid,
+ dygraphs::dyAxis("x", axisLabelColor = "white") %>%
+ dygraphs::dyOptions(colors = clrs, stackedGraph = stack, drawGrid = grid,
animatedZooms = TRUE, axisLineColor = axis_line_color) %>%
- dygraphs::dyRangeSelector(height = 15, strokeColor = blue_color,
- fillColor = base_fill,
- retainDateWindow = TRUE) %>%
dygraphs::dyLegend(show = "never") %>%
dygraphs::dyHighlight(highlightCircleSize = 4,
highlightSeriesBackgroundAlpha = 1/3,
@@ -547,17 +545,17 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
}
# trivariate_plot ---------------------------------------------------------
-.param_trivariate <- function(samps, params,
- transform_x = "identity", transform_y = "identity",
+.param_trivariate <- function(samps, params,
+ transform_x = "identity", transform_y = "identity",
transform_z = "identity",
- pt_size = 1, pt_color = "gray35", show_grid = TRUE,
+ pt_size = 1, pt_color = "gray35", show_grid = TRUE,
flip_y = TRUE) {
nParams <- 3
dim_samps <- dim(samps)
nIter <- dim_samps[1] * dim_samps[2]
samps_use <- array(samps[,, params], c(nIter, nParams))
colnames(samps_use) <- params
-
+
t_x <- get(transform_x)
t_y <- get(transform_y)
t_z <- get(transform_z)
@@ -574,7 +572,7 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
samps_use[,3] <- t_z(samps_use[,3])
colnames(samps_use)[3] <- paste0(transform_z, "(", params[3], ")")
}
- threejs::scatterplot3js(samps_use, size = pt_size, color = pt_color,
+ threejs::scatterplot3js(samps_use, size = pt_size, color = pt_color,
grid = show_grid, flip.y = flip_y)
}
@@ -603,67 +601,67 @@ priors <- data.frame(family = c("Normal", "t", "Cauchy", "Beta", "Exponential",
shape <- if (x >= 6) x + 9 else x
shape
}
-
+
params <- c(param, param2)
nParams <- 2
nIter <- dim(samps)[1] * dim(samps)[2]
samps_use <- array(samps[,,params], c(nIter, nParams))
colnames(samps_use) <- params
-
+
t_x <- get(transform_x)
# t_x <- function(x) eval(parse(text = transform_x))
t_y <- get(transform_y)
- x_lab <- if (transform_x != "identity")
+ x_lab <- if (transform_x != "identity")
paste0(transform_x, "(", param, ")") else param
- y_lab <- if (transform_y != "identity")
+ y_lab <- if (transform_y != "identity")
paste0(transform_y, "(", param2, ")") else param2
param_labs <- labs(x = x_lab, y = y_lab)
-
+
dat <- data.frame(
- x = if (transform_x == "identity")
- samps_use[,param] else t_x(samps_use[,param]),
- y = if (transform_y == "identity")
+ x = if (transform_x == "identity")
+ samps_use[,param] else t_x(samps_use[,param]),
+ y = if (transform_y == "identity")
samps_use[,param2] else t_y(samps_use[,param2]))
if (!is.null(sp)) {
dat$divergent <- c(sapply(sp, FUN = function(y) y[, "divergent__"]))
- dat$hit_max_td <- if (is.null(max_td)) 0 else
- c(sapply(sp, FUN = function(y) as.numeric(y[, "treedepth__"] == max_td)))
+ dat$hit_max_td <- if (is.null(max_td)) 0 else
+ c(sapply(sp, FUN = function(y) as.numeric(y[, "treedepth__"] == max_td)))
} else {
dat$divergent <- 0
dat$hit_max_td <- 0
}
- graph <- ggplot(dat, aes(x = x, y = y, xend=c(tail(x, n=-1), NA),
+ graph <- ggplot(dat, aes(x = x, y = y, xend=c(tail(x, n=-1), NA),
yend=c(tail(y, n=-1), NA)))
-
+
if (lines == "hide") {
- graph <- graph + geom_point(alpha = pt_alpha, size = pt_size,
- shape = shape_translator(pt_shape),
+ graph <- graph + geom_point(alpha = pt_alpha, size = pt_size,
+ shape = shape_translator(pt_shape),
color = pt_color)
} else { # if lines = "back" or "front"
if (lines == "back") {
- graph <- graph +
- geom_path(alpha = lines_alpha, color = lines_color) +
- geom_point(alpha = pt_alpha, size = pt_size,
+ graph <- graph +
+ geom_path(alpha = lines_alpha, color = lines_color) +
+ geom_point(alpha = pt_alpha, size = pt_size,
shape = shape_translator(pt_shape), color = pt_color)
} else { # lines = "front"
- graph <- graph +
- geom_point(alpha = pt_alpha, size = pt_size,
+ graph <- graph +
+ geom_point(alpha = pt_alpha, size = pt_size,
shape = shape_translator(pt_shape), color = pt_color) +
geom_path(alpha = lines_alpha, color = lines_color)
}
}
if (ellipse_lev != "None")
- graph <- graph + stat_ellipse(level = as.numeric(ellipse_lev), color = ellipse_color,
+ graph <- graph + stat_ellipse(level = as.numeric(ellipse_lev), color = ellipse_color,
linetype = ellipse_lty, size = ellipse_lwd, alpha = ellipse_alpha)
if (!all(dat$divergent == 0))
- graph <- graph + geom_point(data = subset(dat, divergent == 1), aes(x,y),
- size = pt_size + 0.5, shape = 21,
+ graph <- graph + geom_point(data = subset(dat, divergent == 1), aes(x,y),
+ size = pt_size + 0.5, shape = 21,
color = "#570000", fill = "#ae0001")
if (!all(dat$hit_max_td == 0))
- graph <- graph + geom_point(data = subset(dat, hit_max_td == 1), aes(x,y),
+ graph <- graph + geom_point(data = subset(dat, hit_max_td == 1), aes(x,y),
size = pt_size + 0.5, shape = 21,
color = "#5f4a13", fill = "#eeba30")
- graph + param_labs +
+ graph + param_labs +
theme_classic() %+replace% (no_lgnd + axis_labs + fat_axis + axis_color + transparent)
}
diff --git a/inst/ShinyStan/html/accept_stat.html b/inst/ShinyStan/html/accept_stat.html
index 5c876af4..ef17e075 100644
--- a/inst/ShinyStan/html/accept_stat.html
+++ b/inst/ShinyStan/html/accept_stat.html
@@ -5,10 +5,15 @@ accept_stat
Quick definition
-The acceptance statistic used by NUTS for slice and Metropolis rejection.
-accept_stat
is acceptance probability averaged over samples
-in the slice. For HMC without NUTS accept_stat
is the standard
-Metropolis acceptance probability.
+The acceptance statistic used by NUTS for the Metropolis correction.
+In the original NUTS implementation a slice sampling step was used to sample a
+state from each Hamiltonian trajectory and accept_stat
was the acceptance
+probability averaged over samples in the slice. In more recent versions of Stan
+the NUTS algorithm uses multinomial sampling over the states for each Hamiltonian
+trajectory.
+
+For HMC without NUTS accept_stat
is the standard Metropolis
+acceptance probability.
More details
diff --git a/inst/ShinyStan/html/citation.html b/inst/ShinyStan/html/citation.html
index e2e186fc..5a97791d 100644
--- a/inst/ShinyStan/html/citation.html
+++ b/inst/ShinyStan/html/citation.html
@@ -2,7 +2,7 @@
@Misc{shinystan-software:2017,
title = {{shinystan}: Interactive Visual and Numerical Diagnostics and Posterior Analysis for {Bayesian} Models},
author = {Stan Development Team},
- note = {R package version 2.3.0},
+ note = {R package version 2.4.0},
year = {2017},
url = {https://mc-stan.org}
})
diff --git a/inst/ShinyStan/html/energy.html b/inst/ShinyStan/html/energy.html
index 6e24ec23..da2ecf89 100644
--- a/inst/ShinyStan/html/energy.html
+++ b/inst/ShinyStan/html/energy.html
@@ -17,4 +17,8 @@ More details
and the first-differenced distribution. Keep an eye out for
discrepancies between these distributions.
+
+For more details see
+ Betancourt, M. (2017). A conceptual introduction to Hamiltonian Monte Carlo.
+
diff --git a/inst/ShinyStan/html/ndivergent.html b/inst/ShinyStan/html/ndivergent.html
index 7747387d..5f9ae386 100644
--- a/inst/ShinyStan/html/ndivergent.html
+++ b/inst/ShinyStan/html/ndivergent.html
@@ -51,4 +51,7 @@ More details
often required so that the posterior curvature is more manageable;
see the section about Neal's Funnel in the Stan manual for an example.
+
+For more details see
+ Betancourt, M. (2017). A conceptual introduction to Hamiltonian Monte Carlo.
diff --git a/inst/ShinyStan/html/nuts.html b/inst/ShinyStan/html/nuts.html
index 49cef645..e2741de5 100644
--- a/inst/ShinyStan/html/nuts.html
+++ b/inst/ShinyStan/html/nuts.html
@@ -1,15 +1,16 @@
HMC and NUTS (very briefly)
+This is a very brief overview. For more details see the Stan manual and
+
Betancourt, M. (2017). A conceptual introduction to Hamiltonian Monte Carlo.
+
Hamiltonian Monte Carlo
Hamiltonian Monte Carlo (HMC) is a Markov chain Monte Carlo (MCMC) method that
uses the derivatives of the density function being sampled to generate
-efficient transitions spanning the posterior (see, e.g.,
-Betancourt and Girolami (
2013)
-for more details).
-It uses an approximate Hamiltonian dynamics simulation based on numerical
-integration which is then corrected by performing a Metropolis acceptance step.
+efficient transitions spanning the posterior. It uses an approximate Hamiltonian
+dynamics simulation based on numerical integration which is then corrected by
+performing a Metropolis acceptance step.
Algorithm summary
@@ -56,11 +57,17 @@
No-U-Turn Sampler
Rather than using a standard Metropolis step, the final parameter value
-is selected with slice sampling along the final evolution step
-(i.e., the second half of iterations generated).
+is selected via multinomial sampling among the Hamiltonian trajectories.
+
Configuring the no-U-turn sampler involves putting a cap on the
treedepth
that it evaluates during each iteration. This is controlled through a maximum depth parameter. The number of leapfrog steps taken is then bounded by 2 to the power
of the maximum depth minus 1.
+
+
+For more details see
+ Betancourt, M. (2017). A conceptual introduction to Hamiltonian Monte Carlo.
+
+
\ No newline at end of file
diff --git a/inst/ShinyStan/server_files/pages/explore/server/multiview.R b/inst/ShinyStan/server_files/pages/explore/server/multiview.R
index ea464197..8ae9aed2 100644
--- a/inst/ShinyStan/server_files/pages/explore/server/multiview.R
+++ b/inst/ShinyStan/server_files/pages/explore/server/multiview.R
@@ -21,7 +21,9 @@ dynamic_trace_plot_multiview <- reactive({
chain = chain,
stack = stack,
warmup_val = N_WARMUP,
- warmup_shade = isTRUE(input$multiview_warmup) && N_WARMUP > 0
+ warmup_shade = isTRUE(input$multiview_warmup) && N_WARMUP > 0,
+ x_lab = "Iteration",
+ y_lab = input$param
)
)
})
diff --git a/inst/ShinyStan/ui_files/dynamic_trace_helptext.R b/inst/ShinyStan/ui_files/dynamic_trace_helptext.R
index 857f7c19..4211223d 100644
--- a/inst/ShinyStan/ui_files/dynamic_trace_helptext.R
+++ b/inst/ShinyStan/ui_files/dynamic_trace_helptext.R
@@ -3,7 +3,6 @@ div(
helpText(
style = "font-size: 11px;",
"Use your mouse to highlight areas in the traceplot to zoom into. Double-click to reset.",
- "You can also use the range selector below the graph for panning and zooming.",
"The number in the small black box in the bottom left corner controls the",
em("roll period."),
"If you specify a roll period of N the resulting graph will be a moving average,",
diff --git a/inst/ShinyStan/ui_files/glossary.R b/inst/ShinyStan/ui_files/glossary.R
index 9693eda5..2b1cf5a0 100644
--- a/inst/ShinyStan/ui_files/glossary.R
+++ b/inst/ShinyStan/ui_files/glossary.R
@@ -33,6 +33,11 @@ div(
withMathJax(),
includeHTML("html/ndivergent.html")
),
+ tabPanel(
+ "energy",
+ withMathJax(),
+ includeHTML("html/energy.html")
+ ),
tabPanel(
"stepsize",
includeHTML("html/stepsize.html")
diff --git a/inst/ShinyStan/ui_files/help.R b/inst/ShinyStan/ui_files/help.R
index 8ac2e5bc..dbefba28 100644
--- a/inst/ShinyStan/ui_files/help.R
+++ b/inst/ShinyStan/ui_files/help.R
@@ -16,7 +16,7 @@ div(
"To ask a question or suggest a new feature visit the",
a(
"Stan users message board.",
- href = "https://groups.google.com/forum/?fromgroups#!forum/stan-users"
+ href = "http://discourse.mc-stan.org"
)
),
br(),
diff --git a/inst/ShinyStan/ui_utils.R b/inst/ShinyStan/ui_utils.R
index 676ddd8b..7a153309 100644
--- a/inst/ShinyStan/ui_utils.R
+++ b/inst/ShinyStan/ui_utils.R
@@ -1,6 +1,6 @@
source_ui <- function(...) {
source(
- file.path("ui_files", ...),
+ file.path("ui_files", ...),
local = TRUE
)$value
}
@@ -77,11 +77,11 @@ a_glossary <- function(id) {
# plotOutput generators ---------------------------------------------------
-dygraphOutput_175px <- function(id)
+dygraphOutput_175px <- function(id)
dygraphs::dygraphOutput(id, height = "175px")
-plotOutput_200px <- function(id, ...)
+plotOutput_200px <- function(id, ...)
plotOutput(id, height = "200px")
-plotOutput_400px <- function(id, ...)
+plotOutput_400px <- function(id, ...)
plotOutput(id, height = "400px")
@@ -100,7 +100,7 @@ condPanel_dens_prior <- function(dist, ...) {
alpha_calc_pt <- function(N) {
if (N <= 100) return(1)
else if (N <= 200) return(0.75)
- else if (N >= 1500) return(0.15)
+ else if (N >= 1500) return(0.15)
else 1 - pnorm(N/1500)
}
@@ -125,20 +125,20 @@ transformation_selectInput <- function(id) {
transform_helpText <- function(var = "x") {
div(
- if (var == "x")
- helpText(style = "font-size: 13px;",
+ if (var == "x")
+ helpText(style = "font-size: 13px;",
"To apply a transformation",
- "select a function and click",
+ "select a function and click",
code("Transform"))
else if (var == "x,y")
- helpText(style = "font-size: 13px;",
+ helpText(style = "font-size: 13px;",
"To apply transformations",
- "select a function for x and/or y",
+ "select a function for x and/or y",
"and click", code("Transform"))
- else
- helpText(style = "font-size: 13px;",
+ else
+ helpText(style = "font-size: 13px;",
"To apply transformations",
- "select a function for x, y, and/or z",
+ "select a function for x, y, and/or z",
"and click", code("Transform"))
)
}
@@ -156,9 +156,9 @@ help_points <- hT11(
"a transition hitting the maximum treedepth."
)
help_dynamic <- hT11(
- "Use your mouse or the sliders to select areas in the",
- "traceplot to zoom into. The other plots on the screen",
- "will update accordingly. Double-click to reset."
+ "Use your mouse to select a range in the traceplot to zoom into. ",
+ "The other plots on the screen will update accordingly. ",
+ "Double-click to reset."
)
diff --git a/man-roxygen/seealso-as.shinystan.R b/man-roxygen/seealso-as.shinystan.R
index a8ed30bd..e543f1da 100644
--- a/man-roxygen/seealso-as.shinystan.R
+++ b/man-roxygen/seealso-as.shinystan.R
@@ -1 +1 @@
-#' @seealso \code{\link{as.shinystan}} for creating shinystan objects.
+#' @seealso \code{\link{as.shinystan}} for creating \code{shinystan} objects.
diff --git a/man-roxygen/seealso-drop_parameters.R b/man-roxygen/seealso-drop_parameters.R
index fffa9631..83e590d4 100644
--- a/man-roxygen/seealso-drop_parameters.R
+++ b/man-roxygen/seealso-drop_parameters.R
@@ -1,2 +1,2 @@
-#' @seealso \code{\link{drop_parameters}} to remove parameters from a shinystan
-#' object.
+#' @seealso \code{\link{drop_parameters}} to remove parameters from a
+#' \code{shinystan} object.
diff --git a/man-roxygen/seealso-generate_quantity.R b/man-roxygen/seealso-generate_quantity.R
index 84d0b939..7b28dc75 100644
--- a/man-roxygen/seealso-generate_quantity.R
+++ b/man-roxygen/seealso-generate_quantity.R
@@ -1,2 +1,2 @@
-#' @seealso \code{\link{generate_quantity}} to add a new quantity to a shinystan
-#' object.
+#' @seealso \code{\link{generate_quantity}} to add a new quantity to a
+#' \code{shinystan} object.
diff --git a/man-roxygen/seealso-launch.R b/man-roxygen/seealso-launch.R
index b612ae62..29b5892f 100644
--- a/man-roxygen/seealso-launch.R
+++ b/man-roxygen/seealso-launch.R
@@ -1,2 +1,2 @@
-#' @seealso \code{\link{launch_shinystan}} to launch the ShinyStan interface
-#' using a particular shinystan object.
+#' @seealso \code{\link{launch_shinystan}} to launch the 'ShinyStan' interface
+#' using a particular \code{shinystan} object.
diff --git a/man-roxygen/seealso-update_sso.R b/man-roxygen/seealso-update_sso.R
index c553be6c..7a9c59ed 100644
--- a/man-roxygen/seealso-update_sso.R
+++ b/man-roxygen/seealso-update_sso.R
@@ -1,2 +1,2 @@
-#' @seealso \code{\link{update_sso}} to update a shinystan object created by a
-#' previous version of the package.
+#' @seealso \code{\link{update_sso}} to update a \code{shinystan} object created
+#' by a previous version of the package.
diff --git a/man/as.shinystan.Rd b/man/as.shinystan.Rd
index 10560de1..08d333b3 100644
--- a/man/as.shinystan.Rd
+++ b/man/as.shinystan.Rd
@@ -3,13 +3,13 @@
\docType{methods}
\name{as.shinystan}
\alias{as.shinystan}
+\alias{is.shinystan}
\alias{as.shinystan,array-method}
\alias{as.shinystan,list-method}
\alias{as.shinystan,mcmc.list-method}
\alias{as.shinystan,stanfit-method}
\alias{as.shinystan,stanreg-method}
-\alias{is.shinystan}
-\title{Create and test shinystan objects}
+\title{Create and test \code{shinystan} objects}
\usage{
as.shinystan(X, ...)
@@ -34,9 +34,9 @@ is.shinystan(X)
model_name = NULL, note = NULL, ...)
}
\arguments{
-\item{X}{For \code{as.shinystan}, an object to be converted to a shinystan
-object. See the Methods section below. For \code{is.shinystan}, an object
-to check.}
+\item{X}{For \code{as.shinystan}, an object to be converted to a
+\code{shinystan} object. See the Methods section below. For
+\code{is.shinystan}, an object to check.}
\item{...}{Arguments passed to the individual methods.}
@@ -61,8 +61,9 @@ Code} tab. For \code{stanfit} (\pkg{rstan}) and \code{stanreg}
(\pkg{rstanarm}) objects the model code is automatically retrieved from the
object.}
-\item{note}{Optionally, text to display on ShinyStan's notes page (stored in
-\code{user_model_info} slot).}
+\item{note}{Optionally, text to display on the \strong{Notepad} page in the
+'ShinyStan' GUI (stored in \code{user_model_info} slot of the
+\code{shinystan} object).}
\item{sampler_params, algorithm, max_treedepth}{Rarely used and never
necessary. If using the \code{as.shinystan} method for arrays or lists,
@@ -76,61 +77,64 @@ be either \code{"NUTS"} or \code{"HMC"} (static HMC). If \code{algorithm}
is \code{"NUTS"} then \code{max_treedepth} (an integer indicating the
maximum allowed treedepth when the model was fit) must also be provided.}
-\item{pars}{For stanfit objects (\pkg{rstan}), an optional character vector
-specifying which parameters should be included in the shinystan object.}
+\item{pars}{For stanfit objects (\pkg{rstan}), an optional character vector
+specifying which parameters should be included in the \code{shinystan}
+object.}
-\item{ppd}{For stanreg objects (\pkg{rstanarm}), \code{ppd}
+\item{ppd}{For \code{stanreg} objects (\pkg{rstanarm}), \code{ppd}
(logical) indicates whether to draw from the posterior predictive
-distribution before launching ShinyStan. The default is \code{TRUE},
+distribution before launching the app. The default is \code{TRUE},
although for very large objects it can be convenient to set it to
\code{FALSE} as drawing from the posterior predictive distribution can be
time consuming. If \code{ppd} is \code{TRUE} then graphical posterior
-predictive checks are available when ShinyStan is launched.}
+predictive checks are available when 'ShinyStan' is launched.}
\item{seed}{Passed to \code{\link[rstanarm]{pp_check}} (\pkg{rstanarm}) if
\code{ppd} is \code{TRUE}.}
}
\value{
-\code{as.shinystan} returns a shinystan object, which is an instance
- of S4 class \code{"shinystan"}.
+\code{as.shinystan} returns a \code{shinystan} object, which is an
+ instance of S4 class \code{"shinystan"}.
- \code{is.shinystan} returns \code{TRUE} if the tested object is a shinystan
- object and \code{FALSE} otherwise.
+ \code{is.shinystan} returns \code{TRUE} if the tested object is a
+ \code{shinystan} object and \code{FALSE} otherwise.
}
\description{
-The \code{as.shinystan} function creates shinystan objects that
- can be used with \code{\link{launch_shinystan}} and various other functions
- in the \pkg{shinystan} package. \code{as.shinystan} is a generic for which
- the \pkg{shinystan} package provides several methods. Currently methods are
- provided for creating shinystan objects from arrays, lists of matrices,
- stanfit objects (\pkg{rstan}), stanreg objects (\pkg{rstanarm}), and
- mcmc.list objects (\pkg{coda}).
+The \code{as.shinystan} function creates \code{shinystan}
+ objects that can be used with \code{\link{launch_shinystan}} and various
+ other functions in the \pkg{shinystan} package. \code{as.shinystan} is a
+ generic for which the \pkg{shinystan} package provides several methods.
+ Currently methods are provided for creating \code{shinystan} objects from
+ arrays, lists of matrices, \code{stanfit} objects (\pkg{rstan}),
+ \code{stanreg} objects (\pkg{rstanarm}), and \code{mcmc.list} objects
+ (\pkg{coda}).
- \code{is.shinystan} tests if an object is a shinystan object.
+ \code{is.shinystan} tests if an object is a \code{shinystan} object.
}
\section{Methods (by class)}{
\itemize{
-\item \code{array}: Create a shinystan object from a 3-D
+\item \code{array}: Create a \code{shinystan} object from a 3-D
\code{\link{array}} of simulations. The array should have dimensions
corresponding to iterations, chains, and parameters, in that order.
-\item \code{list}: Create a shinystan object from a \code{\link{list}}
-of matrices. Each \code{\link{matrix}} (or 2-D array) should contain the
-simulations for an individual chain and all of the matrices should have the
-same number of iterations (rows) and parameters (columns). Parameters
-should have the same names and be in the same order.
+\item \code{list}: Create a \code{shinystan} object from a
+\code{\link{list}} of matrices. Each \code{\link{matrix}} (or 2-D array)
+should contain the simulations for an individual chain and all of the
+matrices should have the same number of iterations (rows) and parameters
+(columns). Parameters should have the same names and be in the same order.
-\item \code{mcmc.list}: Create a shinystan object from an mcmc.list
-(\pkg{coda}).
+\item \code{mcmc.list}: Create a \code{shinystan} object from an
+\code{mcmc.list} object (\pkg{coda}).
-\item \code{stanfit}: Create a shinystan object from a stanfit object
-(\pkg{\link[rstan]{rstan}}). Fewer optional arguments are available for
-this method because all important information can be taken automatically
-from the stanfit object.
+\item \code{stanfit}: Create a \code{shinystan} object from a
+\code{stanfit} object (\pkg{\link[rstan]{rstan}}). Fewer optional arguments
+are available for this method because all important information can be
+taken automatically from the \code{stanfit} object.
-\item \code{stanreg}: Create a shinystan object from a stanreg object
-(\pkg{\link[rstanarm]{rstanarm}}).
+\item \code{stanreg}: Create a \code{shinystan} object from a
+\code{stanreg} object (\pkg{\link[rstanarm]{rstanarm}}).
}}
+
\examples{
\dontrun{
@@ -180,13 +184,12 @@ launch_shinystan(sso)
}
\seealso{
-\code{\link{launch_shinystan}} to launch the ShinyStan interface
- using a particular shinystan object.
+\code{\link{launch_shinystan}} to launch the 'ShinyStan' interface
+ using a particular \code{shinystan} object.
-\code{\link{drop_parameters}} to remove parameters from a shinystan
- object.
+\code{\link{drop_parameters}} to remove parameters from a
+ \code{shinystan} object.
-\code{\link{generate_quantity}} to add a new quantity to a shinystan
- object.
+\code{\link{generate_quantity}} to add a new quantity to a
+ \code{shinystan} object.
}
-
diff --git a/man/deploy_shinystan.Rd b/man/deploy_shinystan.Rd
index 47f2771a..0aaf16a4 100644
--- a/man/deploy_shinystan.Rd
+++ b/man/deploy_shinystan.Rd
@@ -2,7 +2,7 @@
% Please edit documentation in R/deploy_shinystan.R
\name{deploy_shinystan}
\alias{deploy_shinystan}
-\title{Deploy a ShinyStan app on the web using shinyapps.io by RStudio}
+\title{Deploy a 'ShinyStan' app on the web using 'shinyapps.io' by 'RStudio'}
\usage{
deploy_shinystan(sso, appName, account = NULL, ..., deploy = TRUE)
}
@@ -29,7 +29,7 @@ deployment is successful.}
for deployment (also invisibly).
}
\description{
-Requires a (free or paid) ShinyApps account. Visit
+Requires a (free or paid) 'ShinyApps' account. Visit
\url{http://www.shinyapps.io/} to sign up.
}
\details{
@@ -45,7 +45,7 @@ In \code{...}, the arguments \code{ppcheck_data} and
}
\examples{
\dontrun{
-# For this example assume sso is the name of the shinystan object for
+# For this example assume sso is the name of the \\code{shinystan} object for
# the model you want to use. Assume also that you want to name your app
# 'my-model' and that your shinyapps.io username is 'username'.
@@ -62,8 +62,7 @@ deploy_shinystan(sso, appName = "my-model")
The example in the \emph{Deploying to shinyapps.io} vignette that
comes with this package.
- \url{http://www.shinyapps.io/} to sign up for a free or paid ShinyApps
+ \url{http://www.shinyapps.io/} to sign up for a free or paid 'ShinyApps'
account and for details on how to configure your account on your local
- system using RStudio's \pkg{\link[rsconnect]{rsconnect}} package.
+ system using the \pkg{\link[rsconnect]{rsconnect}} package from 'RStudio'.
}
-
diff --git a/man/drop_parameters.Rd b/man/drop_parameters.Rd
index 116d5d4b..ad334884 100644
--- a/man/drop_parameters.Rd
+++ b/man/drop_parameters.Rd
@@ -2,7 +2,7 @@
% Please edit documentation in R/drop_parameters.R
\name{drop_parameters}
\alias{drop_parameters}
-\title{Drop parameters from a shinystan object}
+\title{Drop parameters from a \code{shinystan} object}
\usage{
drop_parameters(sso, pars)
}
@@ -18,11 +18,12 @@ only a subset of the elements of a non-scalar parameter.}
\code{sso}, with \code{pars} dropped.
}
\description{
-Remove selected parameters from a shinystan object. This is useful if you
-have a very large shinystan object when you only want to look at a subset of
-parameters. With a smaller shinystan object, \code{\link{launch_shinystan}}
-will be faster and you should experience better performance (responsiveness)
-after launching when using the ShinyStan app.
+Remove selected parameters from a \code{shinystan} object. This is useful if
+you have a very large \code{shinystan} object when you only want to look at a
+subset of parameters. With a smaller \code{shinystan} object,
+\code{\link{launch_shinystan}} will be faster and you should experience
+better performance (responsiveness) after launching when using the
+'ShinyStan' app.
}
\examples{
# Using example shinystan object 'eight_schools'
@@ -38,7 +39,6 @@ print(sso@param_names)
}
\seealso{
-\code{\link{generate_quantity}} to add a new quantity to a shinystan
- object.
+\code{\link{generate_quantity}} to add a new quantity to a
+ \code{shinystan} object.
}
-
diff --git a/man/generate_quantity.Rd b/man/generate_quantity.Rd
index 975e1da0..67bed19d 100644
--- a/man/generate_quantity.Rd
+++ b/man/generate_quantity.Rd
@@ -11,7 +11,7 @@ generate_quantity(sso, param1, param2, fun, new_name)
\item{param1}{Name of first parameter as character string.}
-\item{param2}{Optional. Name of second paramter as character string.}
+\item{param2}{Optional. Name of second parameter as character string.}
\item{fun}{Function to call, i.e. \code{function(param1)} or
\code{function(param1,param2)}. See Examples, below.}
@@ -36,7 +36,6 @@ sso <- generate_quantity(sso, fun = "-",
}
\seealso{
-\code{\link{drop_parameters}} to remove parameters from a shinystan
- object.
+\code{\link{drop_parameters}} to remove parameters from a
+ \code{shinystan} object.
}
-
diff --git a/man/launch_shinystan.Rd b/man/launch_shinystan.Rd
index 9cf89d4c..bf9e10dc 100644
--- a/man/launch_shinystan.Rd
+++ b/man/launch_shinystan.Rd
@@ -2,30 +2,40 @@
% Please edit documentation in R/launch_shinystan.R
\name{launch_shinystan}
\alias{launch_shinystan}
-\title{Launch the ShinyStan app}
+\alias{launch_shinystan.default}
+\alias{launch_shinystan.shinystan}
+\title{Launch the 'ShinyStan' app}
\usage{
-launch_shinystan(object, rstudio = getOption("shinystan.rstudio"), ...)
+launch_shinystan(object, ...)
+
+\method{launch_shinystan}{default}(object, ...,
+ rstudio = getOption("shinystan.rstudio"))
+
+\method{launch_shinystan}{shinystan}(object, ...,
+ rstudio = getOption("shinystan.rstudio"))
}
\arguments{
-\item{object}{An object of class shinystan, stanfit, or stanreg. To use other
-types of objects first create a shinystan object using
+\item{object}{The object to use. For the default method this can be an object
+of class \code{"shinystan"}, \code{"stanfit"}, or \code{"stanreg"}. To use
+other types of objects first create a shinystan object using
\code{\link{as.shinystan}}.}
-\item{rstudio}{Only relevant for RStudio users. The default (\code{FALSE}) is
-to launch the app in the user's default web browser rather than RStudio's
-pop-up Viewer. Users can change the default to \code{TRUE} by setting the
-global option \code{options(shinystan.rstudio = TRUE)}.}
-
\item{...}{Optional arguments passed to \code{\link[shiny]{runApp}}.}
+
+\item{rstudio}{Only relevant for 'RStudio' users. The default (\code{FALSE})
+is to launch the app in the user's default web browser rather than the
+pop-up Viewer provided by 'RStudio'. Users can change the default to
+\code{TRUE} by setting the global option \code{options(shinystan.rstudio =
+TRUE)}.}
}
\value{
The \code{launch_shinystan} function is used for the side effect of
- starting the ShinyStan app, but it also returns a shinystan object, an
- instance of S4 class \code{"shinystan"}.
+ starting the 'ShinyStan' app, but it also returns a \code{shinystan}
+ object, an instance of S4 class \code{"shinystan"}.
}
\description{
-Launch the ShinyStan app in the default web browser. RStudio users also have
-the option of launching the app in RStudio's pop-up Viewer.
+Launch the 'ShinyStan' app in the default web browser. 'RStudio' users also
+have the option of launching the app in the pop-up Viewer.
}
\examples{
\dontrun{
@@ -61,19 +71,15 @@ sf_sso <- launch_shinystan(sf)
# Example 3: 'fit' is an mcmc.list, array or list of matrices
#######################################
-# First create shinystan object (see ?as.shinystan for full details)
-fit_sso <- as.shinystan(fit, model_name = "Example")
-
-# Now fit_sso is a shinystan object and so Example 1 (above) applies.
+# First create shinystan object (see ?as.shinystan) for full details)
}
}
\seealso{
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
-\code{\link{update_sso}} to update a shinystan object created by a
- previous version of the package.
+\code{\link{update_sso}} to update a \code{shinystan} object created
+ by a previous version of the package.
\code{\link{launch_shinystan_demo}} to try a demo.
}
-
diff --git a/man/launch_shinystan_demo.Rd b/man/launch_shinystan_demo.Rd
index 90e56a5f..2690aee5 100644
--- a/man/launch_shinystan_demo.Rd
+++ b/man/launch_shinystan_demo.Rd
@@ -1,9 +1,9 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/launch_shinystan.R
\name{launch_shinystan_demo}
-\alias{eight_schools}
\alias{launch_shinystan_demo}
-\title{ShinyStan demo}
+\alias{eight_schools}
+\title{'ShinyStan' demo}
\usage{
launch_shinystan_demo(demo_name = "eight_schools",
rstudio = getOption("shinystan.rstudio"), ...)
@@ -13,14 +13,15 @@ launch_shinystan_demo(demo_name = "eight_schools",
the only option, but additional demos may be available in future releases.
\describe{
\item{\code{eight_schools}}{Hierarchical meta-analysis model. See
- \emph{Meta Analysis} chapter of the Stan manual (chapter 11.2 in version
- 2.9), \url{http://mc-stan.org/documentation/}.}
+ \emph{Meta Analysis} chapter of the 'Stan' manual
+ \url{http://mc-stan.org/users/documentation/}.}
}}
-\item{rstudio}{Only relevant for RStudio users. The default (\code{FALSE}) is
-to launch the app in the user's default web browser rather than RStudio's
-pop-up Viewer. Users can change the default to \code{TRUE} by setting the
-global option \code{options(shinystan.rstudio = TRUE)}.}
+\item{rstudio}{Only relevant for 'RStudio' users. The default (\code{FALSE})
+is to launch the app in the user's default web browser rather than the
+pop-up Viewer provided by 'RStudio'. Users can change the default to
+\code{TRUE} by setting the global option \code{options(shinystan.rstudio =
+TRUE)}.}
\item{...}{Optional arguments passed to \code{\link[shiny]{runApp}}.}
}
@@ -28,7 +29,7 @@ global option \code{options(shinystan.rstudio = TRUE)}.}
An S4 shinystan object.
}
\description{
-ShinyStan demo
+'ShinyStan' demo
}
\examples{
\dontrun{
@@ -41,9 +42,8 @@ sso_demo <- launch_shinystan_demo()
}
\seealso{
-\code{\link{launch_shinystan}} to launch the ShinyStan interface
- using a particular shinystan object.
+\code{\link{launch_shinystan}} to launch the 'ShinyStan' interface
+ using a particular \code{shinystan} object.
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
}
-
diff --git a/man/rename_model.Rd b/man/rename_model.Rd
index 6ec1eb84..deec5874 100644
--- a/man/rename_model.Rd
+++ b/man/rename_model.Rd
@@ -14,4 +14,3 @@ This function is deprecated and will be removed in a future release. Please
use the \code{\link{model_name}} function instead.
}
\keyword{internal}
-
diff --git a/man/retrieve.Rd b/man/retrieve.Rd
index d5de2467..66505d0c 100644
--- a/man/retrieve.Rd
+++ b/man/retrieve.Rd
@@ -22,15 +22,15 @@ From a shinystan object get rhat, effective sample size, posterior
quantiles, means, standard deviations, sampler diagnostics, etc.
}
\details{
-The argument \code{what} can take on the values below. Args:
- \code{arg} means that \code{arg} can be specified in \code{...} for this
+The argument \code{what} can take on the values below. 'Args:
+ \code{arg}' means that \code{arg} can be specified in \code{...} for this
value of \code{what}.
\describe{
\item{\code{"rhat"}, \code{"Rhat"}, \code{"r_hat"}, or \code{"R_hat"}}{returns: Rhat statistics. Args: \code{pars}}
\item{\code{"N_eff"}, \code{"n_eff"}, \code{"neff"}, \code{"Neff"}, \code{"ess"}, or \code{"ESS"}}{returns: Effective sample sizes. Args: \code{pars}}
\item{\code{"mean"}}{returns: Posterior means. Args: \code{pars}}
\item{\code{"sd"}}{returns: Posterior standard deviations. Args: \code{pars}}
- \item{\code{"se_mean"} or \code{"mcse"}}{returns: Monte carlo standard error. Args: \code{pars}}
+ \item{\code{"se_mean"} or \code{"mcse"}}{returns: Monte Carlo standard error. Args: \code{pars}}
\item{\code{"median"}}{returns: Posterior medians. Args: \code{pars}.}
\item{\code{"quantiles"} or any string with \code{"quant"} in it (not case sensitive)}{returns: 2.5\%, 25\%, 50\%, 75\%, 97.5\% posterior quantiles. Args: \code{pars}.}
\item{\code{"avg_accept_stat"} or any string with \code{"accept"} in it (not case sensitive)}{returns: Average value of "accept_stat" (which itself is the average acceptance probability over the NUTS subtree). Args: \code{inc_warmup}}
@@ -54,4 +54,3 @@ retrieve(sso, "prop_divergent")
retrieve(sso, "prop_divergent", inc_warmup = TRUE)
}
-
diff --git a/man/shinystan-class.Rd b/man/shinystan-class.Rd
index 6109e542..2e229c4e 100644
--- a/man/shinystan-class.Rd
+++ b/man/shinystan-class.Rd
@@ -2,12 +2,13 @@
% Please edit documentation in R/shinystan-objects.R
\docType{class}
\name{shinystan-class}
-\alias{shinystan}
\alias{shinystan-class}
-\title{S4 shinystan objects}
+\alias{shinystan}
+\title{S4 \code{shinystan} objects}
\description{
-See \code{\link{as.shinystan}} for documentation on creating
- shinystan objects and \code{\link{eight_schools}} for an example object.
+See \code{\link{as.shinystan}} for documentation on creating
+ \code{shinystan} objects and \code{\link{eight_schools}} for an example
+ object.
}
\section{Slots}{
@@ -31,24 +32,24 @@ models only).}
\item{\code{n_warmup}}{(\code{"integer"}) Number of warmup iterations per chain.}
-\item{\code{user_model_info}}{(\code{"character"}) Notes to display on ShinyStan's
-\strong{Notepad} page.}
+\item{\code{user_model_info}}{(\code{"character"}) Notes to display on the
+\strong{Notepad} page in the 'ShinyStan' GUI.}
-\item{\code{model_code}}{(\code{"character"}) Model code to display on ShinyStan's
-\strong{Model Code} page.}
+\item{\code{model_code}}{(\code{"character"}) Model code to display on the
+\strong{Model Code} page in the 'ShinyStan' GUI.}
\item{\code{misc}}{(\code{"list"}) Miscellaneous, for internal use.}
}}
+
\seealso{
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
-\code{\link{drop_parameters}} to remove parameters from a shinystan
- object.
+\code{\link{drop_parameters}} to remove parameters from a
+ \code{shinystan} object.
-\code{\link{generate_quantity}} to add a new quantity to a shinystan
- object.
+\code{\link{generate_quantity}} to add a new quantity to a
+ \code{shinystan} object.
\code{\link{shinystan-metadata}} to view or change metadata
- associated with a shinystan object.
+ associated with a \code{shinystan} object.
}
-
diff --git a/man/shinystan-metadata.Rd b/man/shinystan-metadata.Rd
index 074881ce..0f5079d7 100644
--- a/man/shinystan-metadata.Rd
+++ b/man/shinystan-metadata.Rd
@@ -1,12 +1,12 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sso-metadata.R
\name{shinystan-metadata}
-\alias{model_code}
-\alias{model_name}
-\alias{notes}
\alias{shinystan-metadata}
\alias{sso_info}
-\title{View or change metadata associated with a shinystan object}
+\alias{model_code}
+\alias{notes}
+\alias{model_name}
+\title{View or change metadata associated with a \code{shinystan} object}
\usage{
sso_info(sso)
@@ -37,29 +37,31 @@ notes.}
chains, iterations, warmup iterations, etc. It does not return anything.
\code{model_code} returns or replaces model code stored in a
- shinystan object. If \code{code} is \code{NULL} then any existing model
- code stored in \code{sso} is returned as a character string. If \code{code}
- is specified then an updated shinystan object is returned with \code{code}
- added. For shinystan objects created from stanfit (\pkg{rstan}) and stanreg
- (\pkg{rstanarm}) objects, model code is automatically taken from that
- object and does not need to be added manually. From within the ShinyStan
- interface model code can be viewed on the \strong{Model Code} page.
-
-\code{notes} returns, amends, or replaces notes stored in a shinystan
- object. If \code{note} is \code{NULL} then any existing notes stored in
- \code{sso} are returned as a character string. If \code{note} is specified
- then an updated shinystan object is returned with either \code{note} added
- to the previous notes (if \code{replace=FALSE}) or overwritten by
- \code{note} (if \code{replace = TRUE}). From within the ShinyStan
- interface, notes are viewable on the \strong{Notepad} page.
+ \code{shinystan} object. If \code{code} is \code{NULL} then any existing
+ model code stored in \code{sso} is returned as a character string. If
+ \code{code} is specified then an updated \code{shinystan} object is
+ returned with \code{code} added. For \code{shinystan} objects created from
+ stanfit (\pkg{rstan}) and stanreg (\pkg{rstanarm}) objects, model code is
+ automatically taken from that object and does not need to be added
+ manually. From within the 'ShinyStan' interface model code can be viewed on
+ the \strong{Model Code} page.
+
+\code{notes} returns, amends, or replaces notes stored in a
+ \code{shinystan} object. If \code{note} is \code{NULL} then any existing
+ notes stored in \code{sso} are returned as a character string. If
+ \code{note} is specified then an updated \code{shinystan} object is
+ returned with either \code{note} added to the previous notes (if
+ \code{replace=FALSE}) or overwritten by \code{note} (if \code{replace =
+ TRUE}). From within the 'ShinyStan' interface, notes are viewable on the
+ \strong{Notepad} page.
\code{model_name} returns or replaces the model name associated with
- a shinystan object. If \code{name} is \code{NULL} then the current model
- name is returned. If \code{name} is specified then \code{sso} is returned
- with an updated model name.
+ a \code{shinystan} object. If \code{name} is \code{NULL} then the current
+ model name is returned. If \code{name} is specified then \code{sso} is
+ returned with an updated model name.
}
\description{
-View or change metadata associated with a shinystan object
+View or change metadata associated with a \code{shinystan} object
}
\examples{
# use eight_schools example object
@@ -123,12 +125,11 @@ identical(model_name(sso), "some other name")
}
\seealso{
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
-\code{\link{drop_parameters}} to remove parameters from a shinystan
- object.
+\code{\link{drop_parameters}} to remove parameters from a
+ \code{shinystan} object.
-\code{\link{generate_quantity}} to add a new quantity to a shinystan
- object.
+\code{\link{generate_quantity}} to add a new quantity to a
+ \code{shinystan} object.
}
-
diff --git a/man/shinystan-package.Rd b/man/shinystan-package.Rd
index b2f98cbc..43681e1d 100644
--- a/man/shinystan-package.Rd
+++ b/man/shinystan-package.Rd
@@ -3,32 +3,32 @@
\docType{package}
\name{shinystan-package}
\alias{shinystan-package}
-\title{ShinyStan interface and shinystan R package}
+\title{'ShinyStan' interface and \code{shinystan} R package}
\description{
\if{html}{
\figure{stanlogo.png}{options: width="50px" alt="mc-stan.org"}
\emph{Stan Development Team}
}
-Applied Bayesian data analysis is primarily implemented through the Markov
-chain Monte Carlo (MCMC) algorithms offered by various software packages.
-When analyzing a posterior sample obtained by one of these algorithms the
+Applied Bayesian data analysis is primarily implemented through the Markov
+chain Monte Carlo (MCMC) algorithms offered by various software packages.
+When analyzing a posterior sample obtained by one of these algorithms the
first step is to check for signs that the chains have converged to the target
-distribution and and also for signs that the algorithm might require tuning
-or might be ill-suited for the given model. There may also be theoretical
-problems or practical inefficiencies with the specification of the model.
-ShinyStan provides interactive plots and tables helpful for analyzing a
+distribution and and also for signs that the algorithm might require tuning
+or might be ill-suited for the given model. There may also be theoretical
+problems or practical inefficiencies with the specification of the model. The
+'ShinyStan' app provides interactive plots and tables helpful for analyzing a
posterior sample, with particular attention to identifying potential problems
with the performance of the MCMC algorithm or the specification of the model.
-ShinyStan is powered by RStudio's Shiny web application framework and works
-with the output of MCMC programs written in any programming language (and has
-extended functionality for models fit using the rstan package and the
-No-U-Turn sampler).
+'ShinyStan' is powered by the 'Shiny' web application framework by 'RStudio'
+and works with the output of MCMC programs written in any programming
+language (and has extended functionality for models fit using the \pkg{rstan}
+package and the No-U-Turn sampler).
}
-\section{ShinyStan has extended functionality for Stan models}{
+\section{'ShinyStan' has extended functionality for 'Stan' models}{
-Stan (\url{http://mc-stan.org}) models can be run in R using the
+'Stan' (\url{http://mc-stan.org}) models can be run in \R using the
\pkg{\link[rstan]{rstan}} and \pkg{\link[rstanarm]{rstanarm}} packages.
}
@@ -38,14 +38,14 @@ Stan (\url{http://mc-stan.org}) models can be run in R using the
The \pkg{shinystan} package allows you to store the basic components of an
entire project (code, posterior samples, graphs, tables, notes) in a single
object, a \code{\link[=as.shinystan]{shinystan object}} (sso, for short).
- Users can save many of the plots as ggplot2 objects for further
+ Users can save many of the plots as \pkg{ggplot2} objects for further
customization and easy integration in reports or post-processing for
publication.
The \code{\link{deploy_shinystan}} function lets you easily deploy your own
- ShinyStan apps online for any of your models using RStudio's shinyapps.io
- service. Each of your apps (each of your models) will have a unique url and
- will be compatible with Safari, Firefox, Chrome, and most other browsers.
+ 'ShinyStan' apps online for any of your models using the shinyapps.io
+ service from 'RStudio'. Each of your apps (each of your models) will have a
+ unique url and will be compatible with most web browsers.
}
\section{License}{
@@ -65,16 +65,16 @@ Stan (\url{http://mc-stan.org}) models can be run in R using the
\section{Help and bug reports}{
\itemize{
- \item Stan Users Google group (\url{https://groups.google.com/forum/#!forum/stan-users})
- \item ShinyStan issue tracker (\url{https://github.com/stan-dev/shinystan/issues})
+ \item 'Stan' forums (\url{http://discourse.mc-stan.org})
+ \item 'ShinyStan' issue tracker (\url{https://github.com/stan-dev/shinystan/issues})
}
}
+
\seealso{
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
\code{\link{launch_shinystan_demo}} to try a demo.
-\code{\link{launch_shinystan}} to launch the ShinyStan interface
- using a particular shinystan object.
+\code{\link{launch_shinystan}} to launch the 'ShinyStan' interface
+ using a particular \code{shinystan} object.
}
-
diff --git a/man/update_sso.Rd b/man/update_sso.Rd
index d01d56d2..bf4dc47e 100644
--- a/man/update_sso.Rd
+++ b/man/update_sso.Rd
@@ -30,6 +30,5 @@ sso_new <- update_sso(sso)
}
\seealso{
-\code{\link{as.shinystan}} for creating shinystan objects.
+\code{\link{as.shinystan}} for creating \code{shinystan} objects.
}
-
diff --git a/tests/testthat/test_using_sso.R b/tests/testthat/test_using_sso.R
index c084144f..25faa6b7 100644
--- a/tests/testthat/test_using_sso.R
+++ b/tests/testthat/test_using_sso.R
@@ -12,7 +12,7 @@ old_sso_msg <- "use the 'update_sso' function to update your object"
# launch_shinystan --------------------------------------------------------
test_that("launch_shinystan throws appropriate errors", {
- expect_error(launch_shinystan(sso@summary), "not a valid input")
+ expect_error(launch_shinystan(sso@summary), "object not compatible")
expect_error(launch_shinystan(old_sso), old_sso_msg)
})