Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slide in R as interactive dashboard

Is it impossible to have one slide in an R presentation, say ioslides, that is an interactive dashboard? In Rstudio, flexdashboard must open as a different file and Shiny dashboard doesn't run in a slide presentation. Thanks

like image 281
Luiz Stefanuto Avatar asked Dec 19 '25 09:12

Luiz Stefanuto


1 Answers

You can use runtime: shiny in the header of your document.

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

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

## Slide {.smaller}

### Here are two Shiny widgets

```{r echo = FALSE}
selectInput("n_breaks", label = "Number of bins:",
              choices = c(10, 20, 35, 50), selected = 20)

```

### ...that build a histogram.

```{r echo = FALSE}
renderPlot({
  hist(faithful$eruptions, probability = TRUE, 
       breaks = as.numeric(input$n_breaks),
       xlab = "Duration (minutes)", 
       main = "Geyser eruption duration")
})
```

The result is a slide with an an interactive selectInput that allows to change the breaks of the histogram:

enter image description here

You can find more details here: https://shiny.rstudio.com/articles/interactive-docs.html

like image 68
clemens Avatar answered Dec 22 '25 00:12

clemens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!