View source: R/get_record_table.R
get_record_table | R Documentation |
Calculates the record table from a camera trap data package and so tabulating species records. The record table is a concept developed within the camtrapR package, see this article. See also the function documentation for camtrapR::recordTable(). Note: All dates and times are expressed in UTC format.
get_record_table(
package = NULL,
...,
stationCol = "locationName",
exclude = NULL,
minDeltaTime = 0,
deltaTimeComparedTo = NULL,
removeDuplicateRecords = TRUE,
datapkg = lifecycle::deprecated()
)
package |
Camera trap data package object, as returned by
|
... |
Filter predicates for filtering on deployments |
stationCol |
Character name of the column containing stations.
Default: |
exclude |
Character vector of species names (scientific names or
vernacular names) to be excluded from the record table.
Default: |
minDeltaTime |
Time difference between records of the same species at the same station to be considered independent (in minutes). Default: 0. |
deltaTimeComparedTo |
One of |
removeDuplicateRecords |
Logical. If there are several records of the same species at the same station at exactly the same time, show only one? |
datapkg |
Deprecated.
Use |
A tibble data frame containing species records and additional information about stations, date, time and further metadata, such as filenames and directories of the images (media) linked to the species records. Some more details about the columns returned:
Station
: Character, station names, as found in the deployment column
defined in parameter stationCol
.
Species
: Character, the scientific name of the observed species.
DateTimeOriginal
: Datetime object, as found in column timestamp
of
observations
, in UTC format.
Date
: Date object, the date part of DateTimeOriginal
, in UTC format.
Time
: Character, the time part of DateTimeOriginal
in UTC format.
delta.time.secs
: Numeric, the duration in seconds from the previous
independent record of a given species at a certain location.
delta.time.mins
: Numeric, the duration in minutes from the previous
independent record of a given species at a certain location.
delta.time.hours
: Numeric, the duration in hours from the previous
independent record of a given species at a certain location.
delta.time.days
: Numeric, the duration in days from the previous
independent record of a given species at a certain location.
Directory
: List, file paths of the images linked to the given record,
as defined in column filePath
of media
.
Filename
: List, file names of the images linked to the given record,
as defined in column fileName
of media
.
Latitude
: Numeric, latitude of the station, based on deploymentID
of the observations.
Longitude
: Numeric, longitude of the station, based on deploymentID
of the observations.
clock
: Numeric, clock time in radians.
solar
: Numeric, solar time in radians. Calculated using overlap::sunTime
, which essentially uses the approach described in Nouvellet et al. (2012).
Other exploration functions:
get_cam_op()
,
get_custom_effort()
,
get_effort()
,
get_n_individuals()
,
get_n_obs()
,
get_n_species()
,
get_rai()
,
get_rai_individuals()
,
get_scientific_name()
,
get_species()
get_record_table(mica)
# Set a minDeltaTime of 20 minutes from last independent record for filtering
# out not independent observations
mica_dependent <- mica
mica_dependent$data$observations[4,"timestamp"] <- lubridate::as_datetime("2020-07-29 05:55:00")
get_record_table(
mica_dependent,
minDeltaTime = 20,
deltaTimeComparedTo = "lastIndependentRecord"
)
# Set a minDeltaTime of 20 minutes from last record for filtering out not
# independent observations
get_record_table(
mica_dependent,
minDeltaTime = 20,
deltaTimeComparedTo = "lastRecord"
)
# Exclude observations of mallard
# Exclude is case insensitive and vernacular names are allowed
get_record_table(mica, exclude = "wilde eend")
# Specify column to pass station names
get_record_table(
mica,
stationCol = "locationID",
minDeltaTime = 20,
deltaTimeComparedTo = "lastRecord"
)
# How to deal with duplicates
mica_dup <- mica
# create a duplicate at 2020-07-29 05:46:48, location: B_DL_val 5_beek kleine vijver
mica_dup$data$observations[4,"sequenceID"] <- mica_dup$data$observations$sequenceID[3]
mica_dup$data$observations[4, "deploymentID"] <- mica_dup$data$observations$deploymentID[3]
mica_dup$data$observations[4, "timestamp"] <- mica_dup$data$observations$timestamp[3]
# duplicates are removed by default by get_record_table()
get_record_table(mica_dup)
# duplicate not removed
get_record_table(mica_dup, removeDuplicateRecords = FALSE)
# Applying filter(s) on deployments, e.g. deployments with latitude >= 51.18
get_record_table(mica, pred_gte("latitude", 51.18))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.