generate_report.RdCreates HTML reports from various analysis objects using predefined R Markdown templates. The function automatically selects the appropriate template based on the input object's class and renders a comprehensive report with visualizations and analysis results.
generate_report(
robj,
data_report.reports_sel = c(1, 2, 3, 4),
output_file = NULL,
...
)An R object containing analysis results from functions in this package. The object's class determines which report template is used. Supported classes depend on available templates in the package.
Numeric vector. Specifies which sections of the data report to include in the output: 1 = project level; 2 = species level; 3 = site level; 4 = radius level. The default is `c(1, 2, 3, 4)`, which includes all sections.
Character string. Optional path and filename for the output HTML file. If NULL (default), the report is generated with an automatic filename and opened in RStudio viewer.
Additional parameters passed to the R Markdown template. Available parameters vary by template type and are filtered to only include those recognized by the selected template.
Invisibly returns the file path of the generated report. The function is primarily called for its side effect of generating the report file.
# loading processed data
# \donttest{
dt.samples_trt <- readRDS(system.file("extdata", "dt.samples_trt.rds", package = "growthTrendR"))
# genereate data summary report at project level
outfile_data <- tempfile(fileext = ".html")
generate_report(robj = dt.samples_trt, data_report.reports_sel = c(1), output_file = outfile_data)
#> File location: C:/Users/xjguo/AppData/Local/Temp/RtmpgNxZ8l/fileaa5c72456e4.html
#>
#>
#> processing file: template_data_report.Rmd
#> 1/15
#> 2/15 [setup_data]
#> 3/15
#> 4/15 [qa]
#> 5/15
#> 6/15 [1_project_tab]
#> 7/15
#> 8/15 [2_spc_plot]
#> 9/15
#> 10/15 [3_site_plot]
#> 11/15
#> 12/15 [3_site_tab]
#> 13/15
#> 14/15 [4_radii_tab]
#> 15/15
#> output file: template_data_report.knit.md
#> "C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS template_data_report.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandocaa5c5e674ae5.html --lua-filter "C:\Users\xjguo\AppData\Local\Programs\R\R-4.5.2\library\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\xjguo\AppData\Local\Programs\R\R-4.5.2\library\rmarkdown\rmarkdown\lua\latex-div.lua" --lua-filter "C:\Users\xjguo\AppData\Local\Programs\R\R-4.5.2\library\rmarkdown\rmarkdown\lua\table-classes.lua" --embed-resources --standalone --variable bs3=TRUE --section-divs --template "C:\Users\xjguo\AppData\Local\Programs\R\R-4.5.2\library\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable "mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --include-in-header "C:\Users\xjguo\AppData\Local\Temp\RtmpgNxZ8l\rmarkdown-straa5c20475b58.html"
#>
#> Output created: C:\Users\xjguo\AppData\Local\Temp\RtmpgNxZ8l\fileaa5c72456e4.html
# }