The code below, displays a radiobutton list. When I click on a radio button to select a data set, if afterwards I use the arrow key to move to the next slide, the effect is that the radio button selection keeps jumping to the next radio button in the list, and the presentation does not advance to the next slide. I found some other ways of paginating using for example the key "j", but is does not work.
title: "Presentation"
author: "Giuseppa Cefalu"
date: "2026-08-25"
output: ioslides_presentation
transition: 0.5
runtime: shiny
knitr::opts_chunk$set(echo = FALSE)
body, td {
font-size: 14px;
}
code.r{
font-size: 8px;
}
pre {
font-size: 12px
}
INTRODUCTION
"Vast scale differences in the units of measurement of different variables can affect coefficients. A predictor with much larger scale can dominate the regression model, just by how it is measured.So even though there are no theoretical assumptions about the distribution of predictor variables, it doesn’t mean those distributions don’t matter.
Likewise, if a predictor is highly skewed, those extreme values can have undue influence on the regression coefficients." The Distribution of Independent Variables in Regression Models - The Analysis Factor
Here, we explore the data distributions before a regression is calculated and provide the tools for determining the quality of a regression.
DATA
Distribution and regression analysis are applied to existing R data sets. A list of different data sets is provided as a way of having access to different data distributions or different versions of data for regression analysis.
datasets <- list(Formaldehyde = Formaldehyde, Indometh = Indometh,
Theoph = Theoph,
Loblolly = Loblolly,anscombe = anscombe,
swiss = swiss, DNase = DNase,
mtcars = mtcars, trees = trees)
suppressMessages(suppressWarnings(library(shiny)))
suppressMessages(suppressWarnings(library(dplyr)))
#suppressMessages(suppressWarnings(library(shinyPredict)))
suppressMessages(suppressWarnings(library (skimr)))
suppressMessages(suppressWarnings(library(ggplot2)))
suppressMessages(suppressWarnings(library(cli)))
RADIO BUTTON LIST
The user sees a radio button list of data sets where each button has the name of the specific data set. Upon selecting a radio button, a specific data set is selected and displayed to the screen. The user can switch selections back an forth.
radioButtons("inDs", "Select dataset:", choices = names(datasets))
DATA SET SELECTED
# reactive expressions update when the input changes.
ds <- reactive( datasets[[input$inDs]] )
reactive(print(head(ds())))
DROP DOWN MENU
This creates a drop down menu for variable selection from your_data_frame.The data frame in his case contains the vector (variables) of the selected data set and the corresponding values.
varSelectInput("inVar", "Select variable:", datasets[[1]])
reactive(
data_input <- updateVarSelectInput(session, "inVar", data = ds())
)
varSelectInput("inVar1", "Select a second variable:", datasets[[1]])
reactive(
data_input2 <- updateVarSelectInput(session, "inVar1", data = ds())
)