ace_summarise_dens: Summarise animal density within an area of interest

Description Usage Arguments Value Examples

View source: R/ace_summarise_dens.R

Description

Summarise animal density within an area of interest

Usage

1
2
3
4
5
6
7
8
9
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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"))
# Obtain ABMI deployments in sample WMUs, keeping unit name
wmu_sample_deployments <- ace_get_cam(wmu_sample, group_id = WMUNIT_NAM)
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)

mabecker89/abmi.camera.extras documentation built on Nov. 19, 2020, 7:17 p.m.