last_first: Find a tag's first detection at its last location

Description Usage Arguments Details Value Author(s)

View source: R/last_first.R

Description

last_first: extract the first detection of a fish at its last known location.

Usage

1
2
3
4
5
6
last_first(
  detdf,
  tagidcol = "TagID",
  datetimecol = "DateTimeUTC",
  stationcol = "Station"
)

Arguments

detdf

a dataframe of detections for multiple tagged animals

tagidcol

Name of the column (in quotes) corresponding to individual tag IDs

datetimecol

Name of the column corresponding to detection date and time (must be in POSIXct ymd_hm/s format)

stationcol

Name of the column corresponding to location or station information

Details

This function takes a dataframe of detections and extracts the first detection of each tag, and the first detection at each tag's last station, and returns a dataframe with this information so that the travel time can then be easily calculated

Value

a dataframe with five columns: TagID, first_det (first detection of tag), first_stn (first station), last_arrival (first detection time at final station), last_stn (station where last arrival was recorded).

Author(s)

Myfanwy Johnston


Myfanwy/tagtales documentation built on Nov. 13, 2021, 6:33 a.m.