calib_02: Calculate calibration metrics of previously filtered tracks...

View source: R/calibrate_methods.R

calib_02R Documentation

Calculate calibration metrics of previously filtered tracks (fine-scale or large-scale)

Description

Calculate calibration metrics of previously filtered tracks (fine-scale or large-scale)

Usage

calib_02(track_cleaned, option)

Arguments

track_cleaned

A dataframe of the filtered track (either fine scale of large scale).

option

A character string, either '"fine"' or '"large"', indicating which type of movement (fine-scale or large-scale) metrics to return.'"fine"' returns home range, mean net squared displacement, and mean residence time. '"large"' returns home range, maximum net squared displacement, and sinuosity.

Value

A dataframe storing either fine scale metrics (home range (HR, km2), mean net squared displacement (NSD, km2) and mean residence time (RT, days)) or large scale metrics (HR, max NSD and sinuosity index).

Examples

# filtering fine-scale movements on porpoise tracks

data(porpoisetrack)
track <-as.data.frame(porpoisetrack)
track$year <- track$tick / 17280
track$yearRound <- floor(track$year) + 1
track$tickNew <- ave(track$tick, track$Id, track$yearRound, FUN = seq_along)
track$day <- track$tickNew / 48
track$dayRound <- floor(track$day) + 1
track$date <- as.POSIXct("2014-01-01 00:00:00", tz = "GMT") + (track$tick * 1800)
track_fine <- track[track$DispersalMode == 0, ]

noon_tracks <- track_fine[format(track_fine$date, "%H:%M:%S") == "12:00:00", ]

# identify 30 consecutive days with noon data
all_days <- sort(unique(as.Date(noon_tracks$date)))
consecutive_days <- NULL

for (i in 1:(length(all_days) - 29)) {
if (all(diff(all_days[i:(i + 29)]) == 1)) {
 consecutive_days <- all_days[i:(i + 29)]
 break
}
}
# filter data to only the 30 consecutive days
filtered_tracks <- noon_tracks[as.Date(noon_tracks$date) %in% consecutive_days, ]

calib_02(filtered_tracks, option = "fine")

jacobnabe/DEPONS2R documentation built on June 10, 2025, 9:27 p.m.