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.
Your two files ui.R
and server.R
have 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.
shinyApp("path_to_the_folder_containing_the_files")
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.
If you create your in one R
file you can also launch it with the shinyApp()
function.
library(shiny)
ui <- fluidPage() #Create the ui
server <- function(input, output){} #create the server
shinyApp(ui = ui, server = server) #run the App
.R
file containing the Shiny application with the paramter appFile
:shinyApp(appFile="path_to_my_R_file_containig_the_app")