launch_shinystan: Launch the 'ShinyStan' app

Description Usage Arguments Value See Also Examples

View source: R/launch_shinystan.R

Description

Launch the 'ShinyStan' app in the default web browser. 'RStudio' users also have the option of launching the app in the pop-up Viewer.

Usage

1
2
3
4
5
6
7
8
9
launch_shinystan(object, ...)

## Default S3 method:
launch_shinystan(object, ...,
  rstudio = getOption("shinystan.rstudio"))

## S3 method for class 'shinystan'
launch_shinystan(object, ...,
  rstudio = getOption("shinystan.rstudio"))

Arguments

object

The object to use. For the default method this can be an object of class "shinystan", "stanfit", or "stanreg". To use other types of objects first create a shinystan object using as.shinystan.

...

Optional arguments passed to runApp.

rstudio

Only relevant for 'RStudio' users. The default (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 TRUE by setting the global option options(shinystan.rstudio = TRUE).

Value

The 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 "shinystan".

See Also

as.shinystan for creating shinystan objects.

update_sso to update a shinystan object created by a previous version of the package.

launch_shinystan_demo to try a demo.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Not run: 
#######################################
# Example 1: 'sso' is a shinystan object
#######################################

# Just launch shinystan
launch_shinystan(sso)

# Launch shinystan and replace sso with an updated version of itself
# if any changes are made to sso while using the app
sso <- launch_shinystan(sso)

# Launch shinystan but save any changes made to sso while running the app
# in a new shinystan object sso2. sso will remained unchanged. 
sso2 <- launch_shinystan(sso) 

#######################################
# Example 2: 'sf' is a stanfit object
#######################################

# Just launch shinystan
launch_shinystan(sf)

# Launch shinystan and save the resulting shinystan object
sf_sso <- launch_shinystan(sf)

# Now sf_sso is a shinystan object and so Example 1 (above) applies when
# using sf_sso. 

#######################################
# Example 3: 'fit' is an mcmc.list, array or list of matrices
#######################################

# First create shinystan object (see ?as.shinystan) for full details)

## End(Not run)

shinystan documentation built on Aug. 2, 2017, 9:01 a.m.