| Title: | Identifying Potential Mortalities and Expelled Tags in AquaticAcoustic Telemetry Arrays |
| Version: | 0.0.1 |
| Description: | A toolkit for identifying potential mortalities and expelled tags in aquatic acoustic telemetry arrays. Designed for arrays with non-overlapping receivers. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| URL: | https://github.com/rosieluain/mort,https://rosieluain.github.io/mort/ |
| BugReports: | https://github.com/rosieluain/mort/issues |
| RoxygenNote: | 7.2.3 |
| LazyData: | true |
| Imports: | lubridate, methods, rlang |
| Suggests: | ggplot2, knitr, plotly, rmarkdown, testthat (≥ 3.0.0) |
| VignetteBuilder: | knitr |
| Depends: | R (≥ 3.5.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2023-09-02 17:53:51 UTC; rosie |
| Author: | Rosie Smith |
| Maintainer: | Rosie Smith <rosieluain@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2023-09-04 09:00:02 UTC |
Shift start time of potential mortalities earlier
Description
Shift the start time of potential mortalities earlier, ifstation/location has not changed.
Usage
backwards(data, morts, ID, station, res.start, stnchange = NULL)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, and duration. Residence events should becontinuous (i.e., not subset by season). |
morts | a dataframe containing potential mortalities. Must use#' the same column names and in the same order as |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
stnchange | a dataframe with the start time and location of the mostrecent station or location change. Must use the same column names and inthe same order as |
Value
a dataframe with one row for each tag ID, including the date/time ofthe residence start when the potential mortality or expelled tag was identified.Returns the inputmorts dataframe if no potential mortalities are shiftedearlier.All input data fields(e.g., any name, location, or species information that was included with theinput data) will be retained.
Examples
morts<-morts(data=events,type="mort",ID="ID",station="Station.Name",method="any")head(morts)# If station change not identified yet:morts_bw<-backwards(data=events,morts=morts,ID="ID",station="Station.Name",res.start="ResidenceStart")head(morts_bw)# Identify station change first:station.change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name")morts_bw<-backwards(data=events,morts=morts,ID="ID",station="Station.Name",res.start="ResidenceStart",stnchange=station.change)head(morts_bw)Sample dead drift direction dataframe
Description
The locations have been given generic station names, due to the sensitive natureof the dataset. The connections between stations (i.e., which stations areconnected by drift and in which direction) are real.
Usage
data(ddd)Format
A data frame with 18 rows and 2 variables.
Details
The variables are as follows:
From. The station where a tag may drift from.
To. The station where a tag may drift to, from the station in From.
Sample acoustic telemetry detection data
Description
These detection data were subset from a real acoustic telemetry dataset of ArcticChar near Kugluktuk, Nunavut. The data were from a project that was acollaboration between the Kugluktuk Hunters and Trappers Organization, theUniversity of Waterloo, and Fisheries and Oceans Canada. The data are valuableto the community of Kugluktuk, and are also sensitive due to their pertinenceto the local fishery for Arctic Char. For this reason, the detections have beengiven generic station names and fish IDs so locations and sample informationis anonymous. The year has also been changed, but otherwise, the detections arereal, and therefore have all the challenges and intricacies of biologicaldata.
Usage
data(detections)Format
A data frame with 447 627 rows (observations) and 3 variables.
Details
The variables are as follows:
DateTimeUTC. The date and time of each detection, in POSIXct format. Thedata are in UTC, as downloaded from the receivers.
Station.Name Name of the receiver location.
ID Unique ID of the fish.
Dead and drifting
Description
Identifies sequential residence events where detected movementbetween stations may be due to drifting of an expelled tag or dead animal.
Usage
drift( data, type, ID, station, res.start = "auto", res.end = "auto", residences = "auto", units = "auto", ddd, from.station, to.station, cutoff = NULL, cutoff.units = NULL, verbose = TRUE)Arguments
data | a data frame of residence events. Residence events must includetag ID, location name, start time, and end time. |
type | the method used to generate the residence events in |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
residences | a character string with the name of the column in |
units | units of the duration of the residence events in |
ddd | a dataframe of stations/locations where detected movement betweenstations may be due to drifting of an expelled tag or dead animal. |
from.station | a string of the name of the column in |
to.station | a string of the name of the column in |
cutoff | the maximum allowable time difference between detections to beconsidered a single residence event. Default is |
cutoff.units | the units of the cutoff. Options are "secs", "mins", "hours","days", and "weeks". |
verbose | option to display progress bar as |
Value
A data frame with one row for each residence event. Format is thesame as the input residence events, but events that may be due to dead driftare combined into single residence events.
Examples
# With no drift:head(events)drift.events<-drift(data=events[events$ID=="A",],type="mort",ID="ID",station="Station.Name",ddd=ddd,from.station="From",to.station="To",verbose=FALSE)head(drift.events)# With cutoff:drift.events<-drift(data=events[events$ID=="A",],type="mort",ID="ID",station="Station.Name",ddd=ddd,from.station="From",to.station="To",cutoff=1,cutoff.units="days",verbose=FALSE)head(drift.events)Sample residence events
Description
Events generated from the sample detection file provided. Events were generatedusing the residences() function in mort.
Usage
data(events)Format
A data frame with 11 487 rows (events) and 5 variables.
Details
The detection data were subset from a real acoustic telemetry dataset of ArcticChar near Kugluktuk, Nunavut. The data were from a project that was acollaboration between the Kugluktuk Hunters and Trappers Organization, theUniversity of Waterloo, and Fisheries and Oceans Canada. The data are valuableto the community of Kugluktuk, and are also sensitive due to their pertinenceto the local fishery for Arctic Char. For this reason, the detections have beengiven generic station names and fish IDs so locations and sample informationis anonymous. The year has also been changed, but otherwise, the detections arereal, and therefore have all the challenges and intricacies of biologicaldata.
The variables are as follows:
ResidenceStart. The start time of the residence events, in POSIXct.
Station.Name. Name of the receiver location.
ID. Unique ID of the fish.
ResidenceEnd. The end time of the residence events, in POSIXct.
ResidenceLength.days. The duration of the residence events. The units aredays, as indicated by the variable name (which is automatically generatedby mort::residences())
Identify potential mortalities from infrequent detections
Description
Identifies potential mortalities or expelled tags from infrequentdetections in passive acoustic telemetry data. Mortalities are identfied basedon a user-defined threshold and timeframe.
Usage
infrequent( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", residences = "auto", units = "auto", method, threshold, threshold.units = NULL, recent.period = NULL, recent.units = NULL, start = NULL, end = NULL, morts.prev = NULL, replace = FALSE, backwards = FALSE, ddd = NULL, from.station = NULL, to.station = NULL, drift.cutoff = NULL, drift.units = NULL, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, end time, and duration. |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specify |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
residences | residences a character string with the name of the column in |
units | Units of the duration of the residence events in |
method | a character string of the threshold method. Options are "recent"and "defined". If "recent", must specify |
threshold | the minimum summed duration of residence events for an animalto be considered alive. Units must be the same as the units of |
threshold.units | the units of |
recent.period | the length of the period of time in which an animal mustbe detected longer than the |
recent.units | the units of recent.period. Options are "secs","mins", "hours", "days", and "weeks". |
start | character string with the start of the user-defined time period to search for infrequentdetections if |
end | character string with the end of the user-defined time period to search for infrequentdetections if |
morts.prev | a dataframe containing potential mortalities. The dataframe musthave the same columns and in the same order as |
replace | if |
backwards | option to examine residence events prior to the one that wasflagged as a potential mortality. If prior residence events are at the samestation/location as the flagged event, the time of the potential mortality is shiftedearlier. |
ddd | an optional dataframe of stations/locations where detected movement betweenstations may be due to drifting of an expelled tag or dead animal. |
from.station | a string of the name of the column in |
to.station | a string of the name of the column in |
drift.cutoff | the maximum allowable time difference between detections to beconsidered a single residence event. Recommended to be the same as usedto generate residence events in |
drift.units | the units of the cutoff. Options are "secs", "mins", "hours","days", and "weeks". Recommended to be the same as used to generateresidence events in |
verbose | option to display updates and progress bars assub-functions are called and run. Default is TRUE. |
Details
Example ofmethod="recent": ifthreshold=10,threshold.units="mins",recent.period=52 andrecent.units="weeks" (1 year), an animal will beflagged as a potential mortality if it was detected for less than 10 minuteswithin a year, ending with the most recent detection.
Example ofmethod="defined": ifthreshold=10,threshold.units="mins",start="2019-10-01", andend="2020-06-01", an animalwill be flagged as a potential mortality if it was detected for less than 10minutes between 01 October 2019 and 01 June 2020.
Value
ifmorts=NULL, a dataframe with one row for each tag ID, including the date/time ofthe residence start when the potential mortality or expelled tag was identified.Ifmorts is specified, any potential mortalities will be added to existingmorts dataframe. Ifmorts is specified andreplace=TRUE, then anymortalities that are flagged byinfrequent() and occurred at an earliertime than those inmorts will be replaced to the earlier date.All input data fields(e.g., any name, location, or species information that was included with theinput data) will be retained.
Examples
## Recent exampleinf_recent<-infrequent(data=events,type="mort",ID="ID",station="Station.Name",method="recent",threshold=72,threshold.units="hours",recent.period=52,recent.units="weeks",verbose=FALSE)head(inf_recent)## User-defined exampleinf_defined<-infrequent(data=events,type="mort",ID="ID",station="Station.Name",method="defined",threshold=12,threshold.units="hours",start="2006-06-15",end="2006-10-15",verbose=FALSE)head(inf_defined)Identify potential mortalities or expelled tags
Description
Identifies potential mortalities or expelled tags from passiveacoustic telemetry data. Mortalities are identified based on thresholdsderived from the dataset itself.
Usage
morts( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", method = "all", units = "auto", residences = "auto", singles = TRUE, backwards = FALSE, drift = "none", ddd = NULL, from.station = NULL, to.station = NULL, drift.cutoff = NULL, drift.units = NULL, season.start = NULL, season.end = NULL, season.overlap = TRUE, morts.prev = NULL, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, end time, and duration. |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specify |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
method | the method to be used in flagging mortalities. Options are"last", "any", "cumulative", or "all" |
units | units of the duration of the residence events in |
residences | a character string with the name of the column in |
singles | specifies if single detections (length of residence event = 0)should be retained. Default is |
backwards | option to examine residence events prior to the one that wasflagged as a potential mortality. If prior residence events are at the samestation/location as the flagged event, the time of the potential mortality is shiftedearlier. Note that if |
drift | option to account for potential drifting in identifyingthresholds and/or mortalities. Options are "none", "threshold","morts", "both". Default is "none". |
ddd | a dataframe of stations/locations where detected movement betweenstations may be due to drifting of an expelled tag or dead animal. |
from.station | a string of the name of the column in |
to.station | a string of the name of the column in |
drift.cutoff | the maximum allowable time difference between detections to beconsidered a single residence event. Recommended to be the same as usedto generate residence events in |
drift.units | the units of the cutoff. Options are "secs", "mins", "hours","days", and "weeks". Recommended to be the same as used to generateresidence events in |
season.start | the start date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
season.end | the end date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
season.overlap | option to include residence events that overlap either thebeginning or the end of the period of interest. If |
morts.prev | a dataframe containing potential mortalities. The dataframe musthave the same columns and in the same order as |
verbose | option to display updates and progress bars assub-functions are called and run. Default is TRUE. |
season | a dataframe with start and end dates of the season(s) of interest |
Value
a dataframe with one row for each tag ID, including the date/time ofthe residence start when the potential mortality or expelled tag was identified.All input data fields(e.g., any name, location, or species information that was included with theinput data) will be retained.
Examples
morts_ex<-morts(data=events,type="mort",ID="ID",station="Station.Name",method="any",verbose=FALSE)head(morts_ex)morts_ex_bw<-morts(data=events,type="mort",ID="ID",station="Station.Name",method="any",backwards=TRUE,verbose=FALSE)head(morts_ex_bw)Plot residence events
Description
Plot residence events, with the option of plotting identifiedmortalities. Plotting uses ggplot2. Interactive option also uses plotly.
Usage
mortsplot( data, type, ID, station, res.start = "auto", res.end = "auto", morts = NULL, singles = TRUE, interactive = FALSE, residences = NULL, units = NULL, season.start = NULL, season.end = NULL, facet = FALSE, facet.axis = "x", facet.by = "season", verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, and end time. |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
morts | a dataframe containing potential mortalities. The dataframe musthave the same ID, station, res.start, res.end, and residences column namesas |
singles | option to adjust the end times of residence events so singledetection events are visible. Adjustment is for visualization purposes onlyand should not obscure or impact the visualization of other residence events. |
interactive | option to generate an interactive plot. |
residences | an optional character string with the name of the columnin |
units | units of the duration of the residence events in |
season.start | the start date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
season.end | the end date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
facet | option to facet by year or season. If |
facet.axis | option to position facets along x or y axis. Options are"x" and "y". Default is "x". Note that |
facet.by | option to facet by "season" (as defined with |
verbose | option to display updates and progress bar as function is run.Default is TRUE. |
Value
a ggplot2 plot. Additional arguments (e.g., formatting axes,legend, aes, manual colour scales) can be added as for any ggplot2 plot.Ifinteractive=TRUE,returns a plotly plot.
Examples
plot<-mortsplot(data=events,type="mort",ID="ID",station="Station.Name")plot# With mortalities plotted over residences:morts<-morts(data=events,type="mort",ID="ID",station="Station.Name",method="any",verbose=FALSE)plot<-mortsplot(data=events,type="mort",ID="ID",station="Station.Name",morts=morts)plotExample of new acoustic telemetry detection data
Description
These are fabricated detection data to demonstrate the use of the reviewfunction.
Usage
data(new.data)Format
A data frame with 35 rows (observations) and 3 variables.
Details
The variables are as follows:
ResidenceStart. The start time of the residence events, in POSIXct.
Station.Name. Name of the receiver location.
ID. Unique ID of the fish.
ResidenceEnd. The end time of the residence events, in POSIXct.
ResidenceLength.days. The duration of the residence events. The units aredays, as indicated by the variable name (which is automatically generatedby mort::residences())
Generate residence events
Description
Generate residence events from passive acoustic telemetry data.
Usage
residences(data, ID, station, datetime, cutoff, units, verbose = TRUE)Arguments
data | a data frame of detection data. |
ID | a string of the name of the column in |
station | a string of the name of the column in |
datetime | a string of the name of the column in |
cutoff | the maximum allowable time difference between detections tobe considered a single residence event. |
units | the units of the cutoff. These will also be the units used to calculate the duration of the residence events.Options are "secs", "mins", "hours", "days", and "weeks". |
verbose | option to display progress bar as residences are generated.Default is TRUE. |
Details
Note that a progress bar appears, based on how many of the unique tagIDs have been processed. There will be a delay both before the progress barappears and after the progress bar has reached 100%, which may be substantialdepending on the size of the telemetry dataset.
Value
A data frame with one row for each residence event, including date/time ofresidence start, date/time of residence end, and duration of residence event. Allinput data fields (e.g., any name, location, or species information that wasincluded with detection data) will be retained.
Examples
head(detections)res.events<-residences(data=detections[1:500,],ID="ID",station="Station.Name",datetime="DateTimeUTC",cutoff=1,units="days",verbose=FALSE)head(res.events)Maximum residence duration
Description
Find the maximum duration of a single residence in the dataset that occurredbefore a station change (i.e., the animal can be assumed to be alive)
Usage
resmax( data, ID, station, res.start, residences, stnchange, drift = FALSE, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, and duration. |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
residences | a character string with the name of the column in |
stnchange | a dataframe with the start time and location of the mostrecent station or location change. Must use the same column names as |
drift | indicates if drift residence events should be included indetermining the maximum residence duration |
verbose | option to display progress bar as function is run. Defaultis TRUE. |
Value
a dataframe with the residence information for the longest residencefor each tag ID that occurred before the most recent station/location change.
Examples
# Identify most recent station changestation.change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name",verbose=FALSE)longest_res_events<-resmax(data=events,ID="ID",station="Station.Name",res.start="ResidenceStart",residences="ResidenceLength.days",stnchange=station.change,verbose=FALSE)head(longest_res_events)Maximum cumulative residence duration
Description
Find the maximum duration that an animal spent at a singlestation/location before a station change (i.e., the animal can be assumedto be alive). Differs fromresmax in that the duration is cumulative -the time of residence events and intervals between residence events are allincluded, provided there are no intervening residence events at otherstations/locations.
Usage
resmaxcml( data, ID, station, res.start, res.end, residences, units, stnchange, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, and duration. |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
residences | a character string with the name of the column in |
units | units of the duration of the residence events in |
stnchange | a dataframe with the start time and location of the mostrecent station or location change. Must use the same column names as |
verbose | option to display progress bar as function is run. Defaultis TRUE. |
Value
a dataframe with the cumulative residence information for eachperiod where an animal was consecutively detected at a single station/location.Records are only given for cumulative residences that occurred before the mostrecent station/location change (i.e., the animal can be assumed to be alive).
Examples
# Identify most recent station changestation.change<-stationchange(data=events[events$ID=="A",],type="mort",ID="ID",station="Station.Name",verbose=FALSE)cumulative_events<-resmaxcml(data=events[events$ID=="A",],ID="ID",station="Station.Name",res.start="ResidenceStart",res.end="ResidenceEnd",residences="ResidenceLength.days",units="days",stnchange=station.change,verbose=FALSE)Review previously identified mortalities using new data
Description
Uses new data to determine if an animal that was previouslyflagged as a mortality made a station/location change and may therefore bealive.
Usage
review( morts, new.data, old.data = NULL, type, ID, station, res.start = "auto", res.end = NULL, residences = NULL, units = NULL, ddd = NULL, from.station = NULL, to.station = NULL, verbose = TRUE)Arguments
morts | a dataframe with previously flagged mortalities. Format doesnot need to match |
new.data | a dataframe of new residence events (i.e., generated fromdetection data that were not included in earlier |
old.data | optional dataframe of residence events that were usedin earlier |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specify |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | an optional string of the name of the column in |
residences | an optional character string with the name of the columnin |
units | optional units of the duration of the residence events in |
ddd | a dataframe of stations/locations where detected movement betweenstations may be due to drifting of an expelled tag or dead animal. |
from.station | a string of the name of the column in |
to.station | a string of the name of the column in |
verbose | option to display progress bar as function and calledfunctions are run. Default is TRUE. |
Value
A dataframe with one row for each tag ID frommortswith a station/location change that was identifiedinnew.data. The remaining fields will include the information for theresidence event that was identified as the station change, so the stationchange can be verified by the user before removing the animal frommorts.All input data fields (e.g., any name, location, or species informationthat was included with the input data) will be retained.
Examples
morts<-morts(data=events,type="mort",ID="ID",station="Station.Name",method="any",verbose=FALSE)undead<-review(morts=morts,new.data=new.data,type="mort",ID="ID",station="Station.Name",verbose=FALSE)Select residence events from specified seasons
Description
Select residence events from specified seasons, to be used toidentify potential mortalities or expelled tags. Useful when animals showstrong seasonal patterns in behaviour. For example, a reduction in movement duringwinter may be falsely identified as a mortality, orincrease the threshold use to identify mortalities, which would then causepotential mortalities to be missed.
Usage
season( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", residences = "auto", units = "auto", season.start, season.end, overlap = TRUE, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, start time, end time, and duration. |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specify |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
residences | a character string with the name of the column in |
units | Units of the duration of the residence events in |
season.start | the start date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
season.end | the end date/time(s) of the period of interest. If theperiod of interest is the same in all study years, must be a character stringin format "dd-mm". Otherwise, must be in POSIXt, or a character string informat YYYY-mm-dd HH:MM:SS. |
overlap | option to include residence events that overlap either thebeginning or the end of the period of interest. If |
verbose | option to display updates and progress bars asfunctions is run. Default is TRUE. |
Value
a dataframe in the same format as the input data, with residenceevents limited to the period(s) of interest.
Examples
# Seasons in format dd-mmseason.events<-season(data=events,type="mort",ID="ID",station="Station.Name",season.start="01-06",season.end="31-10",verbose=FALSE)head(season.events)# Seasons in format YYYY-mm-dd HH:MM:SSseason.start<-c("2003-06-15","2004-06-21")season.end<-c("2003-10-15","2004-10-30")season.events<-season(data=events,type="mort",ID="ID",station="Station.Name",season.start=season.start,season.end=season.end,verbose=FALSE)head(season.events)Ice-free seasons
Description
The year has been changed, due to the sensitive nature of the dataset. Theyears have been changed in the same manner as the detection dates, sothe ice-free dates correspond to the dataset in the same way as the originaldataset.
Usage
data(seasons)Format
A data frame with 5 rows (years) and 2 variables.
Details
The variables are as follows:
Start. The date of ice break-up (the start of the period of interest).
End. The date of ice freeze-up (the end of the period of interest).
Identify most recent station change
Description
Identify the most recent station or location change from passiveacoustic telemetry data.
Usage
stationchange( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", residences = "auto", singles = TRUE, drift = FALSE, ddd = NULL, units = NULL, from.station = NULL, to.station = NULL, verbose = TRUE)Arguments
data | a dataframe of residence events. Residence events must includetag ID, location name, start time, and duration. |
type | the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specify |
ID | a string of the name of the column in |
station | a string of the name of the column in |
res.start | a string of the name of the column in |
res.end | a string of the name of the column in |
residences | a character string with the name of the column in |
singles | specifies if single detections (length of residence event = 0)should be retained. Default is |
drift | option to account for potential drifting in identifyingstation changes. |
ddd | a dataframe of stations/locations where detected movement betweenstations may be due to drifting of an expelled tag or dead animal. |
units | optional units of the duration of the residence events in |
from.station | a string of the name of the column in |
to.station | a string of the name of the column in |
verbose | option to display progress bar as function is run. Defaultis TRUE. |
Value
a dataframe with one row for each tag ID, including the date/time ofthe residence start at the most recent station or location, the date/time ofthe residence end, and duration of the residence event. All input data fields(e.g., any name, location, or species information that was included with theinput data) will be retained.
Examples
stn.change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name",verbose=FALSE)head(stn.change)