InOutPoints: Inbound/Outbound flight leg identification

View source: R/InOutPoints.R

InOutPointsR Documentation

Inbound/Outbound flight leg identification

Description

This function's intention is to partition a track into an inbound and outbound leg demarcated when the bird first stops moving away from the colony. The first stopping point is identified by taking the change in dist2col first derivative, smoothing it with a left aligned rolling mean, and rounding to 1 digit. The first point where the bird is not changing the distance to the colony is the end of the outbound leg, while the last point where the birds is not getting close to the colony is the inbound leg.

Usage

InOutPoints(
  tracks = tracks,
  CaptureID = "CaptureID",
  TripID = "TripID",
  DateTime = "datetime",
  dist2colony = "dist2colony",
  lag = 1,
  nPointsToSmooth = 10,
  minDist2Col = 5,
  Plot = F,
  Lon = "lon",
  Lat = "lat",
  pdfName = "inout_plots.pdf"
)

Arguments

tracks

dataframe with tracking data sorted by ID, tripID, datetime

CaptureID

column name holding animal ID

TripID

column name holding Trip ID

DateTime

column name holding the datetime

dist2colony

column name holding distances to the colony of each point

lag

is the number of points to skip to caculate the change in distance. e.g. if lag=3, the diff between i and i-3 will be calculated

nPointsToSmooth

number of points to smooth to determine legs

minDist2Col

buffer in km around colony that will removed to avoid false out/in leg identification

Plot

True/False whether to plot each trip (good for figuring out the right parameters)

Lon

column name holding Longitude (x-coord) (only needed if Plot==T)

Lat

column name holding Latitude (y coord) (only needed if Plot==T)

pdfName

fullpath to pdf that will be saved (only needed if Plot==T)

Author(s)

Abram B. Fleishman abram@conservationmetrics.com


abfleishman/trakR documentation built on Nov. 21, 2022, 7:59 a.m.