knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

camtrapdp

CRAN status CRAN checks R-CMD-check codecov repo status DOI

Camtrapdp is an R package to read and manipulate Camera Trap Data Packages (Camtrap DP). Camtrap DP is a data exchange format for camera trap data. With camtrapdp you can read, filter and transform data (including to Darwin Core) before further analysis in e.g. camtraptor or camtrapR.

To get started, see:

Installation

Install the latest released version from CRAN:

install.packages("camtrapdp")

Or the development version from GitHub:

# install.packages("devtools")
devtools::install_github("inbo/camtrapdp")

Usage

With camtrapdp you can read a Camtrap DP dataset into your R environment:

library(camtrapdp)

file <- "https://raw.githubusercontent.com/tdwg/camtrap-dp/1.0/example/datapackage.json"
x <- read_camtrapdp(file)
x

read_camtrapdp() will automatically upgrade an older version of Camtrap DP to the latest version. It will also make the data easier to use, by assigning taxonomic information (found in the metadata) to the observations and eventIDs (found in the observations) to the media.

To access the data, use one of the accessor functions like locations():

locations(x)

You can also filter data with one of the filter functions, which automatically filter the related data. For example, here we filter observations on scientific name(s) and return the associated events in that subset:

x %>%
  filter_observations(
    scientificName %in% c("Martes foina", "Mustela putorius")
  ) %>%
  events()

For more functionality, see the function reference.

GBIF pipeline

The Global Biodiversity Information Facility (GBIF) uses camtrapdp to process Camera Trap Data Packages published with the Integrated Publishing Toolkit (IPT). Datasets are first read with read_camtrapdp() and then converted to Darwin Core with write_dwc() and EML with write_eml(). See the Camtrap DP pipeline repository for details.

Meta



inbo/camtrapdp documentation built on Dec. 20, 2024, 3:31 a.m.