Short key for running app when part of R function?

I am trying to set up a R package structure for an Shiny app I am going to develop. My test app.R file looks like this:

myApp <- function(...) {
  ui <- fluidPage(
    "Hello, world!"
  server <- function(input, output, session) {
  # Run the application 
  shinyApp(ui, server)

I learnt from Hadley Wickham's amazing "Mastering Shiny" book that to run this app I can use the following console commands:


This works, great. However, I will be typing these two lines thousands of times during the development of the app. So, it would be great to know if there is a short key combination like Ctrl + Shift + Enter to run this app in RStudio. I already tried Ctrl+Shift+Enter and the Run App button but this gives the error:

> runApp('R')
Error in func(fname, ...) : app.R did not return a shiny.appobj object.

Is there a short-key command for running an app embedded in an R function?

This should help you:

Code Snippets in the RStudio IDE – RStudio Support

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.