htmlrshinyr-markdownioslides

How to make an interactive isoslides presentation using Shiny and Rmarkdown?


When I make a Shiny app in an .Rmd file to make an isoslides presentation, the app "behaves" like a static html page (interactivity is not possible).

For example, the following code in an Rmd file will produce a static html presentation that you can not interactively use.

---
output: ioslides_presentation
---

## Useless App

```{r echo=FALSE, message=FALSE, warning=FALSE}
library(shiny)

ui = fluidPage(
        numericInput("n", "How old are you?", value = 1)
)

server = function(input, output, session) {
        
}

shinyApp(ui, server)

What am I missing?


Solution

  • The above answer is inaccurate.

    For your YAML header

    ---
    output: ioslides_presentation
    runtime: shiny
    ---
    

    To embed your shiny app (assuming it is a separate file):

    ```{r, echo = FALSE, message=F, warning=FALSE}
    shinyAppFile(
      "FileMyAppIsIn/app.R",
      options = list(width = "100%", height = 700)
    )
    ``