knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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:
Install the latest released version from CRAN:
install.packages("camtrapdp")
Or the development version from GitHub:
# install.packages("devtools") devtools::install_github("inbo/camtrapdp")
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 eventID
s (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.
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.
citation("camtrapdp")
.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.