One document holding the maps, tables and summary for an analysis: the same
figures write_connectivity_assets() writes, laid out to read. HTML is a
single self-contained file; PDF is rendered through Typst, so no LaTeX is
needed.
Arguments
- x
A
connectivity_report_dataobject fromconnectivity_report_data().- path
File to write. The extension sets the format. Defaults to the species, today's date and
.html, in the working directory. The directory must already exist.- format
The Quarto format, when
pathcan't say. Taken frompath's extension by default, which is what you want unless the destination is a name something else chose, asshiny::downloadHandler()does.
Details
write_connectivity_report() then render_connectivity_report(), in one
call, through a temporary directory. Use those two instead when you want
the Quarto source to keep or to change.
The report covers the tabular and visual results. The GIS layers travel
with zip_connectivity_assets(), since a GeoTIFF can't live inside a
document.
The format comes from path's extension, as it does for
ggplot2::ggsave(): "report.pdf" writes a PDF and "report.html" an
HTML file. Write both by calling this twice.
Any format Quarto can write to a single file works, so "report.docx"
and "report.rtf" also do what they look like. The Shiny app offers HTML
and PDF only. A .pdf renders through Typst rather than Quarto's
LaTeX-based pdf format, so no TeX install is needed.
Formats that keep their figures in a folder beside the document, such as
.md, are refused: a report has to be one file, and copying the document
alone would lose every figure. Note too that the tabbed sections are
HTML-only and fall back to plain headings everywhere else.
See also
connectivity_report_data() to build x,
write_connectivity_report() for the Quarto source, and
zip_connectivity_assets() for the GIS layers and full tables.
Examples
# \donttest{
report_data <- connectivity_report_data(
habitat = example_habitat(),
barrier = example_barrier(),
species = "Blue Tongue Lizard",
interpatch_distance = 20,
verbose = FALSE
)
# rendering needs the Quarto command line tool
if (quarto_available()) {
generate_connectivity_report(
report_data,
file.path(tempdir(), "lizard-report.html")
)
}
#> Rendering html report...
#> Wrote /tmp/RtmpkGCSr6/lizard-report.html
# }