Hi,
I created an action button in my Shiny App that runs RMarkdown. While it is working I just want to show to user loading screen.
ui:
actionButton("create", "Create Report")
server:
observeEvent(input$create,{
create_report <- function(data,
output_format = html_document(toc = TRUE, toc_depth = 6, theme = "yeti"),
output_file = "report.html",
output_dir = getwd(),
y = NULL,
config = configure_report(),
report_title = "Data Profiling Report",
...) {
## Check if input is data.table
if (!is.data.table(data)) data <- data.table(data)
## Check response variable
if (!is.null(y)) {
if (!(y %in% names(data))) stop("`", y, "` not found in data!")
}
## Get directory of report markdown template
## Render report into html
suppressWarnings(render(
input = 'report.rmd',
output_format = output_format,
output_file = output_file,
output_dir = output_dir,
intermediates_dir = output_dir,
params = list(data = data, report_config = config, response = y, set_title = report_title),
...
))
## Open report
report_path <- path.expand(file.path(output_dir, output_file))
browseURL(report_path)
}
create_report(data())
})
If I can do, I can show console log output to user while Rmd is working.
Console output while Rmd is working: