| Title: | Camera-Trap Report Generator |
|---|---|
| Description: | Provides an extensible workflow for processing camera-trap data in the 'Camtrap DP' format and automatically generating reproducible data-status and ecological reports in HTML or PDF format. The package supports data-quality checks, ecological summaries, visualisations, maps, tables and modular report sections for wildlife-monitoring applications. Optional taxonomic enrichment queries the Global Biodiversity Information Facility Species API <https://techdocs.gbif.org/en/openapi/v1/species> through 'taxize'. |
| Authors: | Elham Ebrahimi [aut, cre] (ORCID: <https://orcid.org/0000-0001-5191-9832>) |
| Maintainer: | Elham Ebrahimi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.64 |
| Built: | 2026-10-08 09:16:14 UTC |
| Source: | https://github.com/spatialecology/camtrapReport |
Create a camReport object from a Camtrap DP dataset.
camData(data, habitat, study_area, update, ...)camData(data, habitat, study_area, update, ...)
data |
A character string giving the path to a Camtrap DP dataset, provided as a ZIP file or an extracted dataset directory. |
habitat |
An optional data frame containing habitat information for
camera locations. The default is |
study_area |
An optional study-area boundary provided as a spatial file
path, a |
update |
A logical value (default |
... |
Additional arguments. These are currently reserved for future use. |
The function reads the input Camtrap DP dataset and creates a camReport
object. The resulting object contains processed camera-trap data, metadata,
summaries, report text, report modules, and data-status information used to
generate automated reports.
If habitat information is provided, it is linked to camera locations and used in habitat-related summaries. If a study-area boundary is provided, it is stored with the object and used in spatial summaries where relevant.
The camReport object is saved within an extracted dataset directory as
__camReport_Object.rds. A later call using that directory reuses the saved
object unless update = TRUE, in which case the object is recreated.
A camReport object.
report(), status(), info(), gui()
source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) cm unlink(example_dataset, recursive = TRUE, force = TRUE)source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) cm unlink(example_dataset, recursive = TRUE, force = TRUE)
Class definitions used by camtrapReport to store camera-trap data, report metadata, report sections, and intermediate report objects.
This is a documentation-only topic and does not return a value.
The camReport class is the main object class used by camtrapReport. Objects
of this class are usually created with camData(). A camReport object
stores the camera-trap dataset, report metadata, processed summaries, report
modules, status-report modules, and settings used for report generation.
Important fields in a camReport object include:
data: A list containing the camera-trap data tables, including
observations, deployments, media, locations, sequences, and taxonomy.
habitat: Optional habitat information linked to camera locations.
study_area: Optional spatial object or path describing the study area.
siteName: Name of the study site.
title: Title used in the generated report.
subtitle: Subtitle used in the generated report.
authors: Author or contributor text used in the generated report.
institute: Institute or organisation text used in the generated report.
description: Study-area or project description used in the generated
report.
years: Years included in the report summaries.
group_definition: Definitions of species or observation groups used in
the report.
setting: Report settings, including selected focus groups,
rem_parameter_scope ("pooled" or "annual"), rem_reps, rem_seed,
and map_basemap ("offline", "cartodb", "esri", or
"openstreetmap"). The offline mode is the default; the OpenStreetMap mode
includes an OpenTopoMap fallback for failed tiles. Bundled report modules
select their REM scope explicitly; the standard profile is pooled and the
EOW profile is annual.
data_status: Data-status summaries generated from the input dataset.
reportObjectElements: Report modules and related objects used to generate
the ecological report.
statusReportObjects: Objects used to generate the data-status report.
camtrapReport also defines supporting classes and class unions used
internally, including camInfo, .Rchunk, .textSection,
characterORnull, characterORlist, characterORlistORnull,
listORnull, and data.frameORnull.
camData(), report(), status(), info(), reportSection()
# Inspect the formal definition of the main report class. methods::getClass("camReport") # Check whether the class is registered. methods::isClass("camReport")# Inspect the formal definition of the main report class. methods::getClass("camReport") # Check whether the class is registered. methods::isClass("camReport")
Launch an interactive Shiny interface for configuring and generating
camtrapReport outputs from an existing camReport
object.
gui(object, launch.browser, max_upload_mb, ...)gui(object, launch.browser, max_upload_mb, ...)
object |
|
launch.browser |
A logical value (default |
max_upload_mb |
A numeric value (default |
... |
Additional arguments passed to |
The function starts a Shiny-based graphical user interface for editing report metadata, selecting report sections, defining focus groups, and generating data-status or ecological reports.
The GUI can be used with an existing camReport object and provides an
interactive alternative to configuring reports directly in R.
Invisibly returns the supplied camReport object after launching the
application.
camData(), report(), status(), info()
Other report generation:
report()
source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) gui(cm) unlink(example_dataset, recursive = TRUE, force = TRUE)source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) gui(cm) unlink(example_dataset, recursive = TRUE, force = TRUE)
Get selected information fields from a camReport
object or update the value of a field used in report generation.
## S4 method for signature 'camReport' info(x, name) ## S4 replacement method for signature 'camReport' info(x, name) <- value## S4 method for signature 'camReport' info(x, name) ## S4 replacement method for signature 'camReport' info(x, name) <- value
x |
|
name |
A character vector naming fields to retrieve, or a single
character string naming the field to update. When omitted from |
value |
The new value to assign to the specified field. |
A camReport object contains metadata and report information extracted from
the camera-trap dataset, such as title, subtitle, authors, institute, site
name, description, and acknowledgement text.
The info function can be used to inspect selected fields. The replacement
form, info(x, name) <- value, can be used to update report information
before generating the report.
info() returns an object of class camInfo containing the
requested
fields. The replacement method returns the updated camReport object
invisibly.
camData(), report(), status(), updateReportSection()
source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) # Retrieve all report information info(cm) # Retrieve selected fields selected_info <- info( cm, name = c("title", "authors", "institute") ) selected_info # Update individual fields info(cm, "title") <- "Camera-trap monitoring report" info(cm, "institute") <- "Example Wildlife Research Institute" # Inspect the updated fields info( cm, name = c("title", "institute") ) unlink(example_dataset, recursive = TRUE, force = TRUE)source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) # Retrieve all report information info(cm) # Retrieve selected fields selected_info <- info( cm, name = c("title", "authors", "institute") ) selected_info # Update individual fields info(cm, "title") <- "Camera-trap monitoring report" info(cm, "institute") <- "Example Wildlife Research Institute" # Inspect the updated fields info( cm, name = c("title", "institute") ) unlink(example_dataset, recursive = TRUE, force = TRUE)
Install packages required for the full camtrapReport workflow, including packages used by optional report modules.
install_all(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) ## S4 method for signature 'ANY' install_all(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) install_All(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) ## S4 method for signature 'ANY' install_All(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...)install_all(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) ## S4 method for signature 'ANY' install_all(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) install_All(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...) ## S4 method for signature 'ANY' install_All(pkgs = NULL, update = FALSE, github = TRUE, gitlab = FALSE, ...)
pkgs |
An optional character vector of additional package names.
The default is |
update |
A logical value. If |
github |
A logical value (default |
gitlab |
A logical value (default |
... |
Additional named arguments passed to |
The function checks the package list used by camtrapReport and installs
packages that are not currently available. Packages configured as GitHub
or GitLab dependencies are installed from their corresponding repositories.
All package installation is handled by pak::pkg_install().
Unlike a direct call to pak, install_all() discovers the packages
declared
by the currently available YAML report modules, including modules added or
modified by users, and combines them with any additional packages supplied
through pkgs. It then delegates resolution and installation to pak. The
function is opt-in and is never called when the package is loaded or a report
is rendered.
install_All() is retained as a deprecated compatibility alias. New code
should use install_all().
When update = TRUE, the requested optional packages are force-reinstalled
from their configured sources using the pak reinstall parameter.
Dependencies are upgraded only when required by the requested packages,
unless upgrade = TRUE is supplied through ....
Called for its side effects. The function returns NULL invisibly.
# Package installation changes the user's R library, so these examples are # deliberately restricted to interactive sessions. if (interactive()) { install_all() install_all(pkgs = "readr") install_all(update = TRUE) # Reinstall the requested packages and also update their dependencies. install_all(update = TRUE, upgrade = TRUE) }# Package installation changes the user's R library, so these examples are # deliberately restricted to interactive sessions. if (interactive()) { install_all() install_all(pkgs = "readr") install_all(update = TRUE) # Reinstall the requested packages and also update their dependencies. install_all(update = TRUE, upgrade = TRUE) }
Manage report modules in camtrapReport. These functions can be used to list existing modules, add new modules, move modules within the report structure, remove modules, restore deleted modules, and empty the module trash.
add_Module(x, before, after, test, object, formats, dir) move_Module(name, before, after, parent, level0, formats, dir) remove_Module(name, recursive, dir) restore_Module(name, batch_id, test, dir) empty_trash(name, id, dir) list_Modules(tree, brief, include_trash, validate, dir)add_Module(x, before, after, test, object, formats, dir) move_Module(name, before, after, parent, level0, formats, dir) remove_Module(name, recursive, dir) restore_Module(name, batch_id, test, dir) empty_trash(name, id, dir) list_Modules(tree, brief, include_trash, validate, dir)
x |
A character string giving the path to a module YAML file to add to the package. |
before |
An optional character string naming the module before which
the new or moved module should be placed. The default is |
after |
An optional character string naming the module after which the
new or moved module should be placed. The default is |
test |
A logical value specifying whether a module is tested before
being added or restored. For |
object |
An optional |
formats |
Output compatibility for the module: |
dir |
An optional path to a writable module registry containing
|
name |
A character string naming the module to move, remove, restore, or
permanently delete from the trash. For |
parent |
An optional character string naming the parent module. If omitted, the current parent is retained when moving a module. |
level0 |
An optional character vector specifying the top-level module
order. The default is |
recursive |
A logical value (default |
batch_id |
An optional character string identifying a deleted-module
batch to restore. The default is |
id |
An optional character string identifying a deleted-module batch to
remove permanently from the trash. The default is |
tree |
A logical value (default |
brief |
A logical value (default |
include_trash |
A logical value (default |
validate |
A logical value (default |
camtrapReport uses a modular report architecture in which each report section is stored as a module. A module can contain section metadata, text, executable R code, required packages, and rendering settings.
Because modules can execute arbitrary R code with the permissions of the current R process, only install modules from trusted sources and inspect their contents before running them.
add_Module() adds a new YAML-defined module to the package module
directory. The module can optionally be inserted before or after an existing
module.
move_Module() changes the position or parent of an existing module within
the hierarchical report structure.
remove_Module() moves a module to the module trash. If recursive = TRUE,
child modules are also moved to the trash.
restore_Module() restores a previously removed module from the trash.
empty_trash() permanently removes modules from the trash.
list_Modules() lists active modules and can optionally include deleted
modules stored in the trash.
list_Modules() returns a data frame, a hierarchical module tree, or
a list containing active and trashed modules. The other functions return
information about the performed operation invisibly.
reportSection(), updateReportSection(), testSection(),
report()
# List modules as a hierarchical tree module_tree <- list_Modules() head(module_tree) # List modules in table form module_table <- list_Modules(tree = FALSE) head(module_table)# List modules as a hierarchical tree module_tree <- list_Modules() head(module_tree) # List modules in table form module_table <- list_Modules(tree = FALSE) head(module_table)
Generate reports from a camReport object. report()
creates an ecological report, while status() creates a data-status report.
A named profile can select an ordered set of modules immediately before
rendering.
report(object, filename, view, test, profile, format) status(object, filename, view, profile, format)report(object, filename, view, test, profile, format) status(object, filename, view, profile, format)
object |
|
filename |
An optional output filename or path. A |
view |
A logical value (default |
test |
A logical value (default |
profile |
An optional profile name or |
format |
Output format, either |
HTML is the default output. PDF output first renders the existing HTML report
and then prints it through a headless Chrome or Edge browser using the
optional pagedown package. This route preserves modules that contain HTML
widgets or HTML-formatted tables. Interactive controls are naturally static
in the resulting PDF. PDF output omits the table of contents and excludes
modules whose registry entry does not support PDF. The formats column
shown by list_Modules() records module compatibility.
Invisibly returns the generated report path.
reportProfile(), sections(), section_names(), camData()
Other report generation:
gui,camReport-method
if (rmarkdown::pandoc_available()) { source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) cm <- sections(cm, "introduction") report_file <- report( cm, filename = tempfile("camtrapReport-report-"), view = FALSE ) file.exists(report_file) unlink(c(report_file, sub("\\.html$", ".Rmd", report_file)), force = TRUE) unlink(example_dataset, recursive = TRUE, force = TRUE) }if (rmarkdown::pandoc_available()) { source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) cm <- sections(cm, "introduction") report_file <- report( cm, filename = tempfile("camtrapReport-report-"), view = FALSE ) file.exists(report_file) unlink(c(report_file, sub("\\.html$", ".Rmd", report_file)), force = TRUE) unlink(example_dataset, recursive = TRUE, force = TRUE) }
A report profile is an ordered selection of modules used to produce an
ecological report and a data-status report. Modules normally come from the
corresponding module pool. A module from the other pool can be selected
with a qualified reference such as "status::spatial".
reportProfile( name, report = character(), status = character(), description = "" ) read_profile(file) write_profile(profile, file, overwrite = FALSE, object = NULL) profile_names(object = NULL) add_profile(object, profile, overwrite = FALSE)reportProfile( name, report = character(), status = character(), description = "" ) read_profile(file) write_profile(profile, file, overwrite = FALSE, object = NULL) profile_names(object = NULL) add_profile(object, profile, overwrite = FALSE)
name |
A non-empty profile name. |
report |
An ordered set of modules for |
status |
An ordered set of modules for |
description |
Optional descriptive text. |
file |
Path to a profile YAML file. |
profile |
A |
overwrite |
A logical value controlling whether an existing profile or file can be replaced. |
object |
A |
Profile entries may be character vectors or data frames. Character entries
use "source::module" notation; unqualified entries default to the report
pool for report and the status pool for status. A data frame can also
contain a parent column to override the parent declared by a module. This
makes it possible, for example, to place status modules below an ecological
report's appendix without modifying the shared module YAML files.
Bundled profiles are registered in each object created by camData(). User
profiles can be registered with add_profile() and shared as YAML files
with read_profile() and write_profile().
reportProfile() and read_profile() return a reportProfile
object. profile_names() returns a character vector. add_profile()
invisibly returns the modified camReport object, and write_profile()
invisibly returns the output path.
sections(), section_names(), report(), status()
profile <- reportProfile( name = "brief", report = c("introduction", "results"), status = c("abstract", "availability") ) profile profile_file <- tempfile(fileext = ".yml") write_profile(profile, profile_file) identical(read_profile(profile_file), profile) unlink(profile_file)profile <- reportProfile( name = "brief", report = c("introduction", "results"), status = c("abstract", "availability") ) profile profile_file <- tempfile(fileext = ".yml") write_profile(profile, profile_file) identical(read_profile(profile_file), profile) unlink(profile_file)
Create a report-section object that stores text and optional R code for a
section of a camReport report. Report sections can be
added to a report to make report generation more flexible, modular, and
extensible.
reportSection(name, title, parent, txt, code_setting, packages, code)reportSection(name, title, parent, txt, code_setting, packages, code)
name |
A character string giving a unique name for the report section. |
title |
A character string giving the section title displayed in the
report. The default is |
parent |
A character string naming the parent section, or |
txt |
A character vector or list containing text to include in the
report section. The default is |
code_setting |
Optional R Markdown chunk options for the code chunk. For
example, |
packages |
An optional character vector giving packages required by the
code chunk. The default is |
code |
Optional R code supplied inside braces, for example,
|
Each report section must have a unique name. If a new section with the same
name as an existing section is added to a report, the existing section is
replaced.
A report section can contain text only, code only, or both text and code.
When the code chunk needs access to the associated camReport object, the
object can be referred to as object inside the code block.
This function is useful for creating custom report modules or extending the default camtrapReport workflow with project-specific text, tables, figures, or analyses.
A .textSection object.
camData(), report(), updateReportSection(), testSection()
Other report sections:
section_names(),
testSection,.textSection-method,
updateReportSection()
tx <- reportSection( name = "introduction", title = "Introduction", parent = NULL, txt = "This is an introduction section." ) tx # Create a section containing text and an R code chunk tx2 <- reportSection( name = "methods", title = "Methods", parent = NULL, txt = "This section summarises the camera deployment design.", code_setting = { c(echo = FALSE, results = "asis", warning = FALSE) }, code = { object$camera_setup |> summary() } ) tx2tx <- reportSection( name = "introduction", title = "Introduction", parent = NULL, txt = "This is an introduction section." ) tx # Create a section containing text and an R code chunk tx2 <- reportSection( name = "methods", title = "Methods", parent = NULL, txt = "This section summarises the camera deployment design.", code_setting = { c(echo = FALSE, results = "asis", warning = FALSE) }, code = { object$camera_setup |> summary() } ) tx2
Get module names or update which sections are used by an ecological or data-status report. Profiles provide named, reusable selections without moving or duplicating the YAML module files.
section_names(keep, exclude, object, profile, report_type) sections(x, n, profile, report_type)section_names(keep, exclude, object, profile, report_type) sections(x, n, profile, report_type)
keep |
An optional character vector of section names to keep. |
exclude |
An optional character vector of section names to exclude. |
object |
An optional |
profile |
An optional profile name or |
report_type |
Which output selection to use: |
x |
|
n |
An optional character vector of modules to include. Qualified names
such as |
section_names() lists modules in a pool or in a profile. Set
report_type = "all" to list both pools. Names from both pools, and names
returned for a profile, use the unambiguous "source::module" notation.
sections() updates the transient module tree used for the next render.
When profile is supplied, it can also inspect or update that registered
profile. Set report_type = "status" to manage the data-status selection.
section_names() and sections(x) return character vectors.
sections(x, n) updates x and returns it invisibly.
reportProfile(), report(), status(), listReportSections()
Other report sections:
reportSection,character-method,
testSection,.textSection-method,
updateReportSection()
section_names() section_names(profile = "default") section_names(report_type = "all") source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) sections(cm, profile = "default") cm <- sections(cm, c("introduction", "methods")) unlink(example_dataset, recursive = TRUE, force = TRUE)section_names() section_names(profile = "default") section_names(report_type = "all") source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) sections(cm, profile = "default") cm <- sections(cm, c("introduction", "methods")) unlink(example_dataset, recursive = TRUE, force = TRUE)
Render a .textSection object as a temporary HTML report to check whether
the section text and code can be rendered successfully.
testSection(x, object, view)testSection(x, object, view)
x |
A |
object |
An optional |
view |
A logical value (default |
This function is mainly used to test custom report sections before they are
added to a full camReport report. It checks whether
the
section text, R Markdown chunk settings, required packages, and R code can be
rendered successfully.
The object argument is only needed when the R code in the section refers to
a camReport object.
Invisibly returns the path to the rendered temporary HTML file.
camData(), reportSection(), updateReportSection(), report()
Other report sections:
reportSection,character-method,
section_names(),
updateReportSection()
tx <- reportSection( name = "introduction", title = "Introduction", parent = NULL, txt = "This is an introduction section.", code = { plot(1:10) } ) # Render the section without opening a browser test_file <- testSection( tx, view = FALSE ) file.exists(test_file) # Remove the generated HTML file unlink(test_file)tx <- reportSection( name = "introduction", title = "Introduction", parent = NULL, txt = "This is an introduction section.", code = { plot(1:10) } ) # Render the section without opening a browser test_file <- testSection( tx, view = FALSE ) file.exists(test_file) # Remove the generated HTML file unlink(test_file)
Update the content of a report section in a
camReport object, or list the report sections
currently
attached to the object.
updateReportSection( x, section, text, title, code, code_name, code_setting, packages, append_text, append_code ) listReportSections(x)updateReportSection( x, section, text, title, code, code_name, code_setting, packages, append_text, append_code ) listReportSections(x)
x |
|
section |
A single character string giving the name or title of the report section to update. |
text |
An optional character value used to update the text body of the
report section. The default is |
title |
An optional character value giving a new title for the report
section. The default is |
code |
Optional R code used to update or add a code chunk. The code can be supplied inside braces. |
code_name |
An optional character string naming the R code chunk. The
default is |
code_setting |
Optional R Markdown chunk options for the code chunk. The
default is |
packages |
An optional character vector giving the R packages required
by the code chunk. The default is |
append_text |
A logical value (default |
append_code |
A logical value (default |
Report sections can be identified using either their name or title.
listReportSections() lists the sections attached to a camReport object
and
can be used to find the exact section names before updating them.
updateReportSection() is useful for adapting the default report content to
project-specific needs, including changing section titles, replacing or
appending text, and adding or updating R code chunks.
updateReportSection() returns the updated camReport object
invisibly. listReportSections() returns a data frame describing the
report sections attached to the object.
camData(), report(), reportSection(), info()
Other report sections:
reportSection,character-method,
section_names(),
testSection,.textSection-method
source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) # List sections currently attached to the report section_catalog <- listReportSections(cm) head(section_catalog) # Update the introduction cm <- updateReportSection( cm, section = "introduction", title = "Project introduction", text = paste( "This report summarises camera-trap monitoring", "data for the example study site." ) ) # Confirm the updated section title updated_catalog <- listReportSections(cm) updated_catalog[ updated_catalog$name == "introduction", c("name", "title"), drop = FALSE ] unlink(example_dataset, recursive = TRUE, force = TRUE)source_dataset <- system.file( "external", "dataset", package = "camtrapReport" ) example_dataset <- tempfile("camtrapReport-example-") dir.create(example_dataset) invisible(file.copy( list.files(source_dataset, full.names = TRUE), example_dataset, recursive = TRUE )) cm <- camData(example_dataset) # List sections currently attached to the report section_catalog <- listReportSections(cm) head(section_catalog) # Update the introduction cm <- updateReportSection( cm, section = "introduction", title = "Project introduction", text = paste( "This report summarises camera-trap monitoring", "data for the example study site." ) ) # Confirm the updated section title updated_catalog <- listReportSections(cm) updated_catalog[ updated_catalog$name == "introduction", c("name", "title"), drop = FALSE ] unlink(example_dataset, recursive = TRUE, force = TRUE)