11# This file is part of shinystan
2- # Copyright (C) Jonah Gabry
2+ # Copyright (C) 2015 Jonah Gabry
33#
44# shinystan is free software; you can redistribute it and/or modify it under the
55# terms of the GNU General Public License as published by the Free Software
1414# this program; if not, see <http://www.gnu.org/licenses/>.
1515
1616
17- # ' Deploy a ShinyStan app to shinyapps.io
17+ # ' Deploy a ShinyStan app on the web using shinyapps.io by RStudio
1818# '
19- # ' Requires a (free or paid) ShinyApps account. Visit
20- # ' \url{http://www.shinyapps.io/} to sign up.
19+ # ' Requires a (free or paid) shinyapps.io account. Visit
20+ # ' \url{http://www.shinyapps.io/} to sign up and for details on how to configure
21+ # ' your account on your local system using RStudio's \pkg{rsconnect} package.
2122# '
2223# ' @export
23- # '
24- # ' @param sso shinystan object.
24+ # ' @param sso A shinystan object.
2525# ' @param appName The name to use for the application. Application names must be
2626# ' at least four characters long and may only contain letters, numbers, dashes
2727# ' and underscores.
28- # ' @param account ShinyApps account username. Only required if more than one
29- # ' ShinyApps account is configured on the system. See
30- # ' \url{http://www.shinyapps.io/} for help configuring your account.
28+ # ' @param account shinyapps.io account username. Only required if more than one
29+ # ' account is configured on the system.
3130# ' @param ... Optional arguments. See Details.
3231# '
3332# ' @details In \code{...}, the arguments \code{ppcheck_data} and
4544# '
4645# ' @examples
4746# ' \dontrun{
48- # ' # For this example assume my_sso is the name of the shinystan object for
47+ # ' # For this example assume sso is the name of the shinystan object for
4948# ' # the model you want to use. Assume also that you want to name your app
50- # ' # 'my-model' and that your ShinyApps username is 'username'.
49+ # ' # 'my-model' and that your shinyapps.io username is 'username'.
5150# '
52- # ' deploy_shinystan(sso = my_sso , appName = "my-model", account = "username")
51+ # ' deploy_shinystan(sso, appName = "my-model", account = "username")
5352# '
5453# ' # If you only have one ShinyApps account configured then you can also omit
5554# ' # the 'account' argument.
5655# '
57- # ' deploy_shinystan(sso = my_sso , appName = "my-model")
56+ # ' deploy_shinystan(sso, appName = "my-model")
5857# ' }
5958# '
6059
6160deploy_shinystan <- function (sso , appName , account = NULL , ... ) {
6261 sso_check(sso )
6362 if (missing(appName ))
64- stop(" Please specify a name for your app using the 'appName' argument" ,
65- call. = FALSE )
63+ stop(" Please specify a name for your app using the 'appName' argument" )
6664
6765 # copy contents to temporary directory and write necessary additional lines to
6866 # ui, server, and global
@@ -93,7 +91,7 @@ deploy_shinystan <- function(sso, appName, account = NULL, ...) {
9391 # save shinystan_object to deployDir
9492 object <- sso
9593 save(object , file = file.path(deployDir , " shinystan_temp_object.RData" ))
96- deploy <- getFromNamespace(" deployApp" , " shinyapps " )
94+ deploy <- getFromNamespace(" deployApp" , " rsconnect " )
9795 # save ppcheck_data and set ppcheck defaults
9896 pp <- list (... )
9997 if (" ppcheck_data" %in% names(pp )) {
@@ -103,6 +101,5 @@ deploy_shinystan <- function(sso, appName, account = NULL, ...) {
103101 set_ppcheck_defaults(appDir = deployDir , yrep_name = pp $ ppcheck_yrep ,
104102 y_name = " y" )
105103 }
106- deploy(appDir = deployDir , appName = appName ,
107- account = account , lint = FALSE )
104+ deploy(appDir = deployDir , appName = appName , account = account , lint = TRUE )
108105}
0 commit comments