View source: R/get_custom_effort.R
get_custom_effort | R Documentation |
Gets the effort for each deployment and a specific time interval such as day,
week, month or year. A custom time window can also be set up. This function
calls get_cam_op()
internally.
get_custom_effort(
package = NULL,
...,
start = NULL,
end = NULL,
group_by = NULL,
unit = "hour",
datapkg = lifecycle::deprecated()
)
package |
Camera trap data package object, as returned by
|
... |
filter predicates |
start |
Start date.
Default: |
end |
End date.
Default: |
group_by |
Character, one of |
unit |
Character, the time unit to use while returning custom effort.
One of: |
datapkg |
Deprecated.
Use |
A tibble data frame with following columns:
deploymentID
: Deployment unique identifier.
locationName
: Location name of the deployments.
begin
: Begin date of the interval the effort is calculated over.
effort
: The effort as number.
unit
: Character specifying the effort unit.
Other exploration functions:
get_cam_op()
,
get_effort()
,
get_n_individuals()
,
get_n_obs()
,
get_n_species()
,
get_rai()
,
get_rai_individuals()
,
get_record_table()
,
get_scientific_name()
,
get_species()
# Effort for each deployment over the entire duration of the project
# (datapackage) measured in hours (default)
get_custom_effort(mica)
# Effort for each deployment expressed in days
get_custom_effort(mica, unit = "day")
# Effort for each deployment from a specific start to a specific end
get_custom_effort(
mica,
start = as.Date("2019-12-15"), # or lubridate::as_date("2019-12-15")
end = as.Date("2021-01-10")
)
# Effort for each deployment at daily interval
get_custom_effort(
mica,
group_by = "day"
)
# Effort for each deployment at weekly interval
get_custom_effort(
mica,
group_by = "week"
)
# Effort for each deployment at monthly interval
get_custom_effort(
mica,
group_by = "month"
)
# Effort for each deployment at yearly interval
get_custom_effort(
mica,
group_by = "year"
)
# Applying filter(s), e.g. deployments with latitude >= 51.18, can be
# combined with other arguments
get_custom_effort(mica, pred_gte("latitude", 51.18), group_by = "month")
# You can afterwards calculate the total effort over all deployments
library(dplyr)
get_custom_effort(mica, group_by = "year", unit = "day") %>%
dplyr::filter(effort > 0) %>%
dplyr::group_by(begin) %>%
dplyr::summarise(
deploymentIDs = list(deploymentID),
locationNames = list(locationName),
ndep = length(unique(deploymentID)),
nloc = length(unique(locationName)),
effort = sum(effort),
unit = unique(unit)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.