filter_media | R Documentation |
Subsets media in a Camera Trap Data Package object, retaining all rows that satisfy the conditions.
Deployments are not filtered.
Observations are filtered on associated mediaID
(for media-based
observations) and eventID
(for event-based observations).
Metadata (x$taxonomic
) are updated to match the filtered observations.
filter_media(x, ...)
x |
Camera Trap Data Package object, as returned by |
... |
Filtering conditions, see |
x
filtered.
Other filter functions:
filter_deployments()
,
filter_observations()
x <- example_dataset()
# Filtering returns x, so pipe with media() to see the result
x %>%
filter_media(captureMethod == "timeLapse") %>%
media()
# Filtering on media also affects associated observations, but not deployments
x_filtered <- filter_media(x, favorite == TRUE)
observations(x_filtered)
# Filtering on multiple conditions (combined with &)
x %>%
filter_media(captureMethod == "activityDetection", filePublic == FALSE) %>%
media()
# Filtering on datetimes is easiest with lubridate
library(lubridate, warn.conflicts = FALSE)
x %>%
filter_media(
timestamp >= lubridate::as_datetime("2020-08-02 05:01:00"),
timestamp <= lubridate::as_datetime("2020-08-02 05:02:00")
) %>%
media()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.