-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployApp.R
31 lines (31 loc) · 1.27 KB
/
deployApp.R
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
## ?rsconnect::deployApp
opW <- options(warn=10)
require(rsconnect)
options(rsconnect.http=c("rcurl","curl","internal")[1]
,rsconnect.check.certificate=FALSE
,rsconnect.http.verbose=FALSE)
account <- c("nplatonov","wwf")[1]
opShiny <- getOption(switch(account[1],nplatonov="rsconnect",wwf="rsconnectWWF"
,"rsconnectDummy"))
if (is.null(opShiny)) {
message("Expected record of 'rsconnect' option (example):")
opShiny <- list(name="yourname"
,token=paste(sample(c(0:9,LETTERS[seq(6)]),32,rep=TRUE),collapse="")
,secret=paste(sample(c(0:9,LETTERS,letters,"+"),40,rep=TRUE),collapse="")
)
str(opShiny)
opShiny <- NULL
stop("Authentification data are not receieved")
}
appname <- c("demography","openday")[2]
appfiles <- c("about.md","demography.bib","interpretation.Rmd",".Renviron"
,"IUCN_pb_subpopulations.xlsx","IUCN_pb_subpopulations.shp.zip"
,"main.R","resources.R","simulate.R","analyze.R","perturb.R"
,"app.R","shinyInit.R","shinyUI.R","shinyServer.R"
,"www"
)
appfiles
with(opShiny,setAccountInfo(name=name,token=token,secret=secret))
deployApp(appName=appname,appFiles=appfiles,account=opShiny$name)
options(opW)
warnings()