| generate_report | R Documentation |
Produces a standalone, self-contained HTML (or PDF) report that documents the fitted distribution, estimated parameters, goodness-of-fit tests, descriptive statistics, diagnostic plots, and (optionally) bootstrap confidence intervals.
If rmarkdown is installed, the report is rendered from an R Markdown template. Otherwise, a pure HTML fallback is used with the diagnostic plot embedded as a base64-encoded PNG image.
generate_report(fit,
output_file = NULL,
file = NULL,
title = "FitVerse: Distribution Fitting Report",
author = "",
boot = NULL,
top_n = 5L,
open = TRUE)
fit |
An object of class |
output_file |
Character: path to the output file. If |
file |
Deprecated alias for |
title |
Character: report title. Defaults to
|
author |
Character: author name to include in the report header.
Default |
boot |
An object of class |
top_n |
Integer: number of distributions to show in the ranking table.
Default |
open |
Logical: open the report in the system's default browser after
writing? Default |
When rmarkdown is available, generate_report() writes a
temporary .Rmd file and calls rmarkdown::render() to produce
a self-contained HTML document using the html_document format with
self_contained = TRUE. The fitted object is passed via a temporary
.rds file to avoid workspace pollution.
When rmarkdown is unavailable, a self-contained HTML file is built in pure R:
The diagnostic plot is saved to a temporary PNG and encoded as a base64 data URI using base64enc (if available) or a manual hex-to-base64 conversion.
Tables are rendered as HTML <table> elements.
The output is a single-file HTML document with embedded CSS.
Invisibly returns the normalised path to the output file (character).
Karuna G. Reddy karuna.reddy@auckland.ac.nz
M. G. M. Khan mgm.khan@usp.ac.fj
bootstrap_ci for confidence intervals to include in the
report.
save_plot to save the diagnostic plot separately.
set.seed(42)
x <- rgamma(300, shape = 2, rate = 0.5)
fit <- fitverse(x, xlab = "Waiting time (s)", plot = FALSE, verbose = FALSE)
# Write report to a temporary directory so no files are left in the working dir
path <- generate_report(fit,
title = "Gamma Fit Example",
author = "Karuna Reddy",
output_file = file.path(tempdir(), "fitverse_report.html"),
open = FALSE)
message("Report saved to: ", path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.