#|context: server
ds <- reactive( datasets[[input$inDs]] )
output$ui <- renderUI(ds)
Error in output$ui <- renderUI(ds) : object 'output' not found
#|context: server
ds <- reactive( datasets[[input$inDs]] )
output$ui <- renderUI(ds)
Error in output$ui <- renderUI(ds) : object 'output' not found
Can you post a minimal reprex that demonstrates the problem?
The original program is created using Shiny on RStudio, and it works very well. Below is the Quarto-Shiny code so far. I am using the format: revealjs and to instantiate the markdown editor I start with ```{r} which becomes just {r}. The back ticks desappear and no backticks are needed to close the markdown block.
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 the selected data.
#| label: libraries
#| echo: true
suppressWarnings(suppressMessages(library(shinylive)))
suppressWarnings(suppressMessages(library(shiny)))
suppressMessages(suppressWarnings(library(rmarkdown)))
suppressMessages(suppressWarnings(library(dplyr)))
suppressMessages(suppressWarnings(library(bslib)))
#| label: data
#| echo: true
#| message: true
#| warning: true
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)
#| label: selectinput
#| echo: true
#| message: true
#| warning: true
titlePanel(tags$h2("DATA SETS", style = "color: blue;"))
radioButtons("inDs", "Select dataset:", choices = names(datasets))
uiOutput("ui")
#|context: server
ds <- reactive( datasets[[input$inDs]] )
output$ui <- renderUI(ds)
##Error in output$ui <- renderUI(ds) : object 'output' not found
varSelectInput("inVar", "Select variable:", datasets[[1]])
varSelectInput("inVar1", "Select a second variable:", datasets[[1]])
#| warning: true
observe(updateVarSelectInput(session, "inVar", data = ds()))
observe(updateVarSelectInput(session, "inVar1", data = ds()))
You need to use server: shiny not profile: shiny.
Thank you: The error does not show up now.
When I use server:shiny instead of profile:shiny in the header, the previous error does not show, but the program does not run and I get a different error:
==> quarto serve Linear.qmd --presentation
ERROR: Unknown option "--presentation". Did you mean option "--profile"?
Also, the button RENDER desappears and is replaced with the button RUN DOCUMENT.
You can't render a quarto document with shiny outputs in - it needs to be running like an app to function. That's why the buttons change. I am not sure why -- presentation is being appended to the quarto call. When I have run shiny inside a revealjs, I just click 'Run Document' and everything works.
Thank you. How do I embed the app into the quarto presentation?