R Language Shiny Launch a Shiny app


You can launch an application in several ways, depending on how you create you app. If your app is divided in two files ui.R and server.R or if all of your app is in one file.

1. Two files app

Your two files ui.R and server.Rhave to be in the same folder. You could then launch your app by running in the console the shinyApp() function and by passing the path of the directory that contains the Shiny app.


You can also launch the app directly from Rstudio by pressing the Run App button that appear on Rstudio when you an ui.R or server.R file open.

Or you can simply write runApp() on the console if your working directory is Shiny App directory.

2. One file app

If you create your in one R file you can also launch it with the shinyApp() function.

  • inside of your code :

ui <- fluidPage() #Create the ui
server <- function(input, output){} #create the server

shinyApp(ui = ui, server = server) #run the App
  • in the console by adding path to a .R file containing the Shiny application with the paramter appFile: