-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
45 lines (34 loc) · 856 Bytes
/
app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Inspired from this blog https://www.mm218.dev/posts/2022-08-04-how-to-use-quarto-for-parameterized-reporting/#parameterized-reports
library(shiny)
library(quarto)
local_covid <- NHSRdatasets::covid19
ui <- fluidPage(
titlePanel("Covid country numbers"),
selectInput(
"country",
"Country:",
c("United_Kingdom",
"Ireland",
"New_Zealand"),
multiple = TRUE,
selected = "Ireland"),
actionButton(
"render",
"Render!"
),
textOutput("status")
)
server <- function(input, output) {
output$status <- renderText({
if (input$render) {
isolate(
quarto::quarto_render(
"covid-analysis.qmd",
execute_params = list(country = input$country)
)
)
paste("Rendering complete at", Sys.time())
}
})
}
shinyApp(ui = ui, server = server)