make_encounters: make_encounters

View source: R/utils.R

make_encountersR Documentation

make_encounters

Description

make_encounters is a convenience function to make an encounter matrix y suitable for use in eFrameREST. It converts long data to the wide format with one row per site.

Usage

make_encounters(sites, events)

Arguments

sites

A data.frame of sites (camera locations). The first three columns MUST be in the following order. 1. Site (or camera) ID; 2. first day of operation for each camera (either day of year or date); 3. Last day of operation for each camera.

events

A data.frame of encounters for each camera, The columns MUST be in the following order. 1. Site (or camera) ID; 2. Day of year (or date) of each encounter; 3. the number of individuals encountered (i.e. group size).

Value

a matrix with the number of encounters for each camera with dimensions M x J where M is the number of sites and J is the maximum number of days operation. Cameras operating for less than J days are assigned NA for those days.

Examples

sites<- HogDeer$sites
encounters<- HogDeer$encounters
y<- make_encounters(sites, encounters)


dslramsey/eradicate documentation built on March 16, 2024, 1:40 p.m.