I am trying to create a presentation using Quarto revealjs format. I can write and run r code with this format, but not shiny. May be this doesn't run on the desktop, but I need to publish like a web site?
I read somewhere that I have to include the statement quarto add quarto-ext/shinylive if I use shinylive instead of shiny, but I do not know where to add it.
The shiny with quarto documents using the format html instead of revealjs runs very well, but it does not create slide. It creates a document.
Shiny does not work using "slidy" either.
---
title: "Linear Regression"
author: "Giuseppa Cefalu"
date: "2026-03-04"
output: slidy_presentation
runtime: shiny
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
rm(list=ls())
Introduction
This is a presentation that reads data files and runs an statistical summary and displays a plot to determine the linearity of data in the file.
The data files are obtained from the R package "datasets" using the command:
output$dat <- renderPrint(data(package = "datasets")$results[ , "Item"])
and manually stored in the variable "datasets".
The user selects a data file from an interactive menu first, and subsequently selects the variables in the data file to run the statistics and the regression on.
Libraries
suppressMessages(suppressWarnings(library(shiny)))
suppressMessages(suppressWarnings(library(rmarkdown)))
suppressMessages(suppressWarnings(library(dplyr)))
suppressMessages(suppressWarnings(library(bslib)))
Data Sets
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)
GUI
ui <- fluidPage(
titlePanel(tags$h2("STATISTICAL ANALYSIS AND LINEARITY FOR R DATA SETS", style = "color: blue;")),
radioButtons("inDs", "Select dataset:", choices = names(datasets))
)
SERVER
function(input, output, session) {
ds <- reactive( datasets[[input$inDs]] )
}