I am trying to have an input in shinyR change a params in an .rmd file. The rmd is saved in the www folder as report.rmd. First post so apologies if it isn't formatted properly.
title: "report"
output: html_document
params:
n: NA
TripID<-params$n
TripID
Using the App:
shinyApp(
ui = fluidPage(
textInput("tripid", "Enter Trip"),
downloadButton("report", "Generate report")
),
server = function(input, output) {
output$report <- downloadHandler(
filename = "report.html",
content = function(file) {
tempReport <- file.path(tempdir(), "report.Rmd")
file.copy("report.Rmd", tempReport, overwrite = TRUE)
params <- list(n = input$tripid)
rmarkdown::render(tempReport, output_file = file,
params = params,
envir = new.env(parent = globalenv())
)
}
)
}
)
#Im getting the error Error in value[3L] :
argument "outputId" is missing, with no default
#Calls: local ... tryCatch -> tryCatchList -> tryCatchOne ->
#Execution halted