Skip to content

Instantly share code, notes, and snippets.

@denisdbell
Last active May 3, 2018 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denisdbell/ccad016a5eef1348c3737d21fbbcb095 to your computer and use it in GitHub Desktop.
Save denisdbell/ccad016a5eef1348c3737d21fbbcb095 to your computer and use it in GitHub Desktop.
This file is used to execute a shiny application
###################################
#### Initializer For Shiny App ####
###################################
#Add shiny library
library("shiny")
#Retrieve command line arguments
args = commandArgs(trailingOnly=TRUE)
if (length(args)==0) {
args[1]="/<default shiny project path>/"
}
#Print working directory(Mostly for debugging)
print(args[1])
#Set the working directory
setwd(args[1])
#Run the shiny application on port 1234
runApp(port = 1234)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment