Summarise animal density within an area of interest

ace_summarise_dens(
  x,
  group_id,
  agg_samp_per = TRUE,
  samp_per_col,
  species_col = common_name,
  dens_col = density,
  conflevel = 0.9
)

Arguments

x

a dataframe of deployments of interest with associated density estimates

group_id

column name (variable) to group by if x contains multiple areas; defaults to NULL (for when a single area is supplied)

agg_samp_per

logical; if FALSE, the default, density is summarised by sampling period; if TRUE, all sampling periods are aggregated

samp_per_col

column name holding sampling period id; defaults to 'samp_per'; not required if agg_samp_per is set to TRUE

species_col

column name holding species id; defaults to 'common_name'

dens_col

column name holding density values for individual camera deployments; defaults to 'density'

conflevel

level of confidence for the confidence interval; defaults to 0.9 (90 percent CI)

Value

A dataframe with estimated density by species, area, and sampling period, along with associated confidence interval.

Examples

library(dplyr) library(sf) # Example aoi of four Wildlife Management Units (WMUs) in Alberta: wmu_sample <- st_read(system.file("extdata/wmu_sample.shp", package = "abmi.camera.extras"))
#> Reading layer `wmu_sample' from data source `C:\Users\mabec\AppData\Local\Temp\RtmpoPZatK\temp_libpath29f82e295388\abmi.camera.extras\extdata\wmu_sample.shp' using driver `ESRI Shapefile' #> Simple feature collection with 4 features and 5 fields #> geometry type: POLYGON #> dimension: XY #> bbox: xmin: 632139.5 ymin: 5997019 xmax: 776266.6 ymax: 6209376 #> projected CRS: NAD83 / Alberta 10-TM (Forest)
# Obtain ABMI deployments in sample WMUs, keeping unit name wmu_sample_deployments <- ace_get_cam(wmu_sample, group_id = WMUNIT_NAM)
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
wmu_sample_deployments_dens <- ace_join_dens(wmu_sample_deployments, species = c("Moose", "Mule deer"), nest = FALSE) # Summarise density by WMU and sampling period wmu_densities <- ace_summarise_dens(x = wmu_sample_deployments_dens, group_id = WMUNIT_NAM, agg_samp_per = FALSE, conflevel = 0.9)