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()))
}