-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
89 lines (63 loc) · 4.01 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# camtrapdp
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/camtrapdp)](https://CRAN.R-project.org/package=camtrapdp)
[![CRAN checks](https://badges.cranchecks.info/worst/camtrapdp.svg)](https://cran.r-project.org/web/checks/check_results_camtrapdp.html)
[![R-CMD-check](https://github.com/inbo/camtrapdp/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/inbo/camtrapdp/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/inbo/camtraptor/branch/main/graph/badge.svg)](https://app.codecov.io/gh/inbo/camtrapdp/)
[![repo status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11490269.svg)](https://doi.org/10.5281/zenodo.11490269)
<!-- badges: end -->
Camtrapdp is an R package to read and manipulate Camera Trap Data Packages (Camtrap DP). [Camtrap DP](https://camtrap-dp.tdwg.org) is a data exchange format for camera trap data. With camtrapdp you can read, filter and transform data (including to [Darwin Core](https://dwc.tdwg.org)) before further analysis in e.g. [camtraptor](https://inbo.github.io/camtraptor/) or [camtrapR](https://cran.r-project.org/package=camtrapR).
To get started, see:
- [Function reference](https://inbo.github.io/camtrapdp/reference/index.html): overview of all functions.
## Installation
Install the latest released version from CRAN:
```{r, eval = FALSE}
install.packages("camtrapdp")
```
Or the development version from [GitHub](https://github.com/inbo/camtrapdp):
```{r, eval = FALSE}
# install.packages("devtools")
devtools::install_github("inbo/camtrapdp")
```
## Usage
With camtrapdp you can **read** a Camtrap DP dataset into your R environment:
```{r}
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](https://inbo.github.io/camtrapdp/reference/index.html#accessor-and-assignment-functions) like `locations()`:
```{r}
locations(x)
```
You can also **filter** data with one of the [filter functions](https://inbo.github.io/camtrapdp/reference/index.html#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:
```{r}
x %>%
filter_observations(
scientificName %in% c("Martes foina", "Mustela putorius")
) %>%
events()
```
For more functionality, see the [function reference](https://inbo.github.io/camtrapdp/reference/index.html).
## GBIF pipeline
The Global Biodiversity Information Facility ([GBIF](https://www.gbif.org/)) uses camtrapdp to process Camera Trap Data Packages published with the Integrated Publishing Toolkit ([IPT](https://www.gbif.org/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](https://github.com/gbif/camtrap-dp-pipeline/tree/master/docker) for details.
## Meta
- We welcome [contributions](https://inbo.github.io/camtrapdp/CONTRIBUTING.html) including bug reports.
- License: MIT
- Get [citation information](https://inbo.github.io/camtrapdp/authors.html#citation) for camtrapdp in R doing `citation("camtrapdp")`.
- Please note that this project is released with a [Contributor Code of Conduct](https://inbo.github.io/camtrapdp/CODE_OF_CONDUCT.html). By participating in this project you agree to abide by its terms.