ace_get_cam: Subset camera deployments by a specified spatial area of...

Description Usage Arguments Value Examples

View source: R/ace_get_cam.R

Description

Subset camera deployments by a specified spatial area of interest

Usage

1
ace_get_cam(aoi, group_id = NULL, dep = NULL, coords = NULL, crs = 4326)

Arguments

aoi

The area of interest as an sf, sfc, or sp (SpatialPolygonsDataFrame) object

group_id

If aoi contains multiple polygons, name of the attribute to be appended to the output dataframe as identifier

dep

A dataframe of camera deployment locations as coordinate points; defaults to NULL, in which case ABMI camera deployment locations are used.

coords

If dep is specified, names of the of numeric columns holding coordinates

crs

coordinate reference system; integer with the EPSG code, or character with proj4string; defaults to 4326.

Value

A dataframe of camera deployments within the supplied area of interest (aoi)

Examples

1
2
3
4
5
6
7
8
9
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)
# Plot results
wmu_sample <- st_transform(wmu_sample, "+init=epsg:4326")
plot(wmu_sample_deployments$geometry, pch = 21, cex = 0.7, col = "blue", bg = "gray80")
plot(wmu_sample$geometry, border = "gray20", col = NA, add = TRUE)

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