Skip to contents

Create a camReport object from a Camtrap DP dataset.

Usage

camData(data, habitat, study_area, update, ...)

Arguments

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 NULL.

study_area

An optional study-area boundary provided as a spatial file path, a SpatVector, or an sf object. The default is NULL.

update

A logical value (default FALSE) specifying whether to recreate a previously saved camReport object.

...

Additional arguments. These are currently reserved for future use.

Value

A camReport object.

Details

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.

Examples

# \donttest{
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)
#> The camReport object is being created...
#> Dataset size: 6.6 MB.
#> File size looks modest, but full object creation may still take several minutes depending on the number of records.
#> Setup is done!
#> Data loaded successfully in 31 sec.
#> camReport object is ready for GMU8 LEUVEN.

cm
#> Camera trap Object for the site : GMU8 LEUVEN 
#> ===================================================== 
#> Total number of sequences       :  10182 
#> Total number of observations    :  10798 
#> Total number of animals         :  4693 
#> Total number of detected species:  41 
#> Date/time (years) with data     :  2018, 2019, 2020, 2021, 2022, and 2023 
#> -----------------------------------------------------

unlink(example_dataset, recursive = TRUE, force = TRUE)
# }