The code below iterates through the slide titles when using the button, but I do not know how to insert the respective slides into "slide 1", "slide 2"...
The reason why I need a button is that the arrow keys that move to the next slide do not work when I make a rdiobutton selection. What happens is that pressing the arrow keys selects the next radio button in the list and the ability to move the next slide using the arrow keys is desabled. I have been looking for some other ways of advancing the presentation (other short cuts), but I have not been able to find any in rmarkdown.
slideIndex <- reactiveVal(1)
observeEvent(input$nexts, {
if (slideIndex() < 3) slideIndex(slideIndex() + 1)
})
observeEvent(input$prev, {
if (slideIndex() > 1) slideIndex(slideIndex() - 1)
})
actionButton("prev", "Previous Slidde")
actionButton("nexts", "Next Slide")
uiOutput("slides")
output$slides <- renderUI({
slideContent <- c(
"# Slide 1\nINTRODUCTION",
"# Slide 2\nRADIO BUTTON LIST",
"# Slide 3\nDATA SET SELECTED",
"# Slide 4\nDROP DOWN MENU"
)
htmltools::HTML(slideContent[slideIndex()])
})