I have an app to aloter the params argument in an Rmd file and then download said rmd file using the shiny app. Where do I save the rmd file and how do I tell shiny where to look?
This is my app:
setwd("C:/Users/JL16/Documents/Apps/qc-app")
library(shiny)
library(markdown)
ui = fluidPage(
textInput("year", "Enter Year"),
downloadButton("report", "Generate report")
)
server <- function(input, output, session) {
output$report <- downloadHandler(
filename = "report.html",
content = function(file) {
params <- list(year = input$year)
rmarkdown::render("report.Rmd",
output_file = file,
params = params,
envir = new.env(parent = globalenv())
)
}
)
}
shinyApp(ui, server)