Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Last active August 29, 2015 14:07
Show Gist options
  • Save nassimhaddad/a2296daf9b1330e28555 to your computer and use it in GitHub Desktop.
Save nassimhaddad/a2296daf9b1330e28555 to your computer and use it in GitHub Desktop.
running shiny apps as server

launch the shiny server in the background from the linux console (Rscript launch_app.R &),
and then when it says: listening on http://127.0.0.1:8787, you can access it via:

http://IP:8787/p/7815/

(where 7815 is the port specified in the .R file)

if (!require(shiny)){
install.packages("shiny", repos = "http://cran.rstudio.com")
require(shiny)
}
if (packageVersion("shiny")<"0.9.1"){
install.packages("shiny", repos = "http://cran.rstudio.com")
require(shiny)
}
if (!require(pwr)){
install.packages("pwr", repos = "http://cran.rstudio.com")
require(pwr)
}
if (!require(reshape2)){
install.packages("reshape2", repos = "http://cran.rstudio.com")
require(reshape2)
}
if (!require(ggplot2)){
install.packages("ggplot2", repos = "http://cran.rstudio.com")
require(ggplot2)
}
if (!require(markdown)){
install.packages("markdown", repos = "http://cran.rstudio.com")
require(markdown)
}
runApp(".", launch.browser = FALSE, port = 7815)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment