How to paginate when using shiny radio buttons with ioslies

I am using shiny radiobuttons with r ioslides and when I click right arrow or space bar to move to the next slide, it does not work. If I use the arrow right feature, the selection moves down the list of radiobuttons, and if I use space bar there is not motion to the next page. I wonder if there is another way to paginate.


title: "Determining Linearity"
author: "Giuseppa Cefalu"
date: "2025-11-05"
output: ioslides_presentation
runtime: shiny

knitr::opts_chunk$set(echo = TRUE)

Please see code below.

Libreries and DATASETS

suppressWarnings(suppressMessages(library(shiny)))
suppressWarnings(suppressMessages(library(dplyr)))
suppressWarnings(suppressMessages(library(rmarkdown)))
suppressWarnings(suppressMessages(library(RODBC)))
```{r eval = TRUE, echo = FALSE} 
datasets <- list(Formaldehyde = Formaldehyde, Indometh = Indometh, 
                 LifeCycleSavings = LifeCycleSavings, OrchardSprays = OrchardSprays, Theoph = Theoph, chickwts = chickwts,faithful = faithful,                   randu = randu,
                 ChickWeight = ChickWeight, Loblolly = Loblolly, anscombe = anscombe, beaver1 = beaver1, nottem = nottem,
                 stackloss = stackloss, swiss = swiss, DNase = DNase,
                 Nile = Nile, mtcars = mtcars, trees = trees)
##
```{r, eval = FALSE, echo = TRUE}

  fluidPage(
    radioButtons("inDs", "Select dataset:", choices = names(datasets)),
varSelectInput("inVar", "Select variable:", datasets[[1]]),
  varSelectInput("inVar1", "Select a second variable:", datasets[[1]])
    
  )
##
```{r, eval = TRUE}
function(input, output, session) {

  # reactive expressions update when the input chages.
  ds <- reactive( datasets[[input$inDs]] )
  # print to the console
  observe(print(head(ds())))

#re-execute when the input updates
  observe(updateVarSelectInput(session, "inVar", data = ds()))
  observe(updateVarSelectInput(session, "inVar1", data = ds()))
  
}

I circumvented the problem by placinng the radio button list and the input boxes side by side, but now, the variables in the input boxes dropdown menu do not get updated when I select s set from the radio buttons list.

  fluidPage(
  fluidRow(
    column (6,
    radioButtons("inDs", "Select dataset:", choices = names(datasets))
    ),
    column(6,
    varSelectInput("inVar", "Select variable:", datasets[[1]]),
    varSelectInput("inVar1", "Select a second variable:", datasets[[1]]) 
    )
    )
  )

SERVER

function(input, output, session) {

  # reactive expressions update when the input chages.
  ds <- reactive( datasets[[input$inDs]] )
  # print to the console
  observe(print(head(ds())))
    
  #re-execute when the input updates
  observe(updateVarSelectInput(session, "inVar", data = ds()))
  observe(updateVarSelectInput(session, "inVar1", data = ds()))
  
  # inVar* updates to console
  observe(cli_alert_info("input$inVar: {input$inVar}"))
  observe(cli_alert_info("input$inVar1: {input$inVar1}"))
  
}

Since I am not receivng any replys, I wonder if there is anything I can read about shiny and ioslides. What I find online is very simple, and it may be the case that shiny and ioslides do not work very well together for more complex apps. Could you please inform me? If shiny an ioslides do not work well together, may be I have to create the presentation without running the program and copying aand pasting the code and the output into the presentation.

I might be wrong, but I think ioslides is a bit outdated? Quarto and reveal.js is the more modern approach: Revealjs – Quarto Using shiny in them is the same as for other quarto documents: Shiny – Quarto I haven't done much, but I made some simple examples in here: shinyworkshop/slides.qmd at main · simon-smart88/shinyworkshop · GitHub (Search for #| context: server)

Thank you for the update. I will check that out.