Title: | Identifying Potential Mortalities and Expelled Tags in Aquatic Acoustic Telemetry Arrays |
---|---|
Description: | A toolkit for identifying potential mortalities and expelled tags in aquatic acoustic telemetry arrays. Designed for arrays with non-overlapping receivers. |
Authors: | Rosie Smith [aut, cre, cph] , Heidi Swanson [fnd] |
Maintainer: | Rosie Smith <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.1 |
Built: | 2024-11-03 05:22:56 UTC |
Source: | https://github.com/rosieluain/mort |
Shift the start time of potential mortalities earlier, if station/location has not changed.
backwards(data, morts, ID, station, res.start, stnchange = NULL)
backwards(data, morts, ID, station, res.start, stnchange = NULL)
data |
a dataframe of residence events. Residence events must include tag ID, location name, start time, and duration. Residence events should be continuous (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 most
recent station or location change. Must use the same column names and in
the same order as |
a dataframe with one row for each tag ID, including the date/time of
the residence start when the potential mortality or expelled tag was identified.
Returns the input morts
dataframe if no potential mortalities are shifted
earlier.
All input data fields
(e.g., any name, location, or species information that was included with the
input data) will be retained.
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)
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)
The locations have been given generic station names, due to the sensitive nature of the dataset. The connections between stations (i.e., which stations are connected by drift and in which direction) are real.
data(ddd)
data(ddd)
A data frame with 18 rows and 2 variables.
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.
These detection data were subset from a real acoustic telemetry dataset of Arctic Char near Kugluktuk, Nunavut. The data were from a project that was a collaboration between the Kugluktuk Hunters and Trappers Organization, the University of Waterloo, and Fisheries and Oceans Canada. The data are valuable to the community of Kugluktuk, and are also sensitive due to their pertinence to the local fishery for Arctic Char. For this reason, the detections have been given generic station names and fish IDs so locations and sample information is anonymous. The year has also been changed, but otherwise, the detections are real, and therefore have all the challenges and intricacies of biological data.
data(detections)
data(detections)
A data frame with 447 627 rows (observations) and 3 variables.
The variables are as follows:
DateTimeUTC. The date and time of each detection, in POSIXct format. The data are in UTC, as downloaded from the receivers.
Station.Name Name of the receiver location.
ID Unique ID of the fish.
Identifies sequential residence events where detected movement between stations may be due to drifting of an expelled tag or dead animal.
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 )
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 )
data |
a data frame of residence events. Residence events must include tag 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 between stations 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 be
considered 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 |
A data frame with one row for each residence event. Format is the same as the input residence events, but events that may be due to dead drift are combined into single residence events.
# 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)
# 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)
Events generated from the sample detection file provided. Events were generated using the residences() function in mort.
data(events)
data(events)
A data frame with 11 487 rows (events) and 5 variables.
The detection data were subset from a real acoustic telemetry dataset of Arctic Char near Kugluktuk, Nunavut. The data were from a project that was a collaboration between the Kugluktuk Hunters and Trappers Organization, the University of Waterloo, and Fisheries and Oceans Canada. The data are valuable to the community of Kugluktuk, and are also sensitive due to their pertinence to the local fishery for Arctic Char. For this reason, the detections have been given generic station names and fish IDs so locations and sample information is anonymous. The year has also been changed, but otherwise, the detections are real, and therefore have all the challenges and intricacies of biological data.
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 are days, as indicated by the variable name (which is automatically generated by mort::residences())
Identifies potential mortalities or expelled tags from infrequent detections in passive acoustic telemetry data. Mortalities are identfied based on a user-defined threshold and timeframe.
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 )
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 )
data |
a dataframe of residence events. Residence events must include tag 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 user
must 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 animal
to 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 must
be 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 infrequent
detections if |
end |
character string with the end of the user-defined time period to search for infrequent
detections if |
morts.prev |
a dataframe containing potential mortalities. The dataframe must
have the same columns and in the same order as |
replace |
if |
backwards |
option to examine residence events prior to the one that was flagged as a potential mortality. If prior residence events are at the same station/location as the flagged event, the time of the potential mortality is shifted earlier. |
ddd |
an optional dataframe of stations/locations where detected movement between stations 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 be
considered a single residence event. Recommended to be the same as used
to 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 generate
residence events in |
verbose |
option to display updates and progress bars as sub-functions are called and run. Default is TRUE. |
Example of method="recent"
: if threshold=10
, threshold.units="mins"
,
recent.period=52
and recent.units="weeks"
(1 year), an animal will be
flagged as a potential mortality if it was detected for less than 10 minutes
within a year, ending with the most recent detection.
Example of method="defined"
: if threshold=10
, threshold.units="mins"
,
start="2019-10-01"
, and end="2020-06-01"
, an animal
will be flagged as a potential mortality if it was detected for less than 10
minutes between 01 October 2019 and 01 June 2020.
if morts=NULL
, a dataframe with one row for each tag ID, including the date/time of
the residence start when the potential mortality or expelled tag was identified.
If morts
is specified, any potential mortalities will be added to existing
morts
dataframe. If morts
is specified and replace=TRUE
, then any
mortalities that are flagged by infrequent()
and occurred at an earlier
time than those in morts
will be replaced to the earlier date.
All input data fields
(e.g., any name, location, or species information that was included with the
input data) will be retained.
## Recent example inf_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 example inf_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)
## Recent example inf_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 example inf_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)
Identifies potential mortalities or expelled tags from passive acoustic telemetry data. Mortalities are identified based on thresholds derived from the dataset itself.
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 )
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 )
data |
a dataframe of residence events. Residence events must include tag 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 user
must 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 was
flagged as a potential mortality. If prior residence events are at the same
station/location as the flagged event, the time of the potential mortality is shifted
earlier. Note that if |
drift |
option to account for potential drifting in identifying thresholds and/or mortalities. Options are "none", "threshold", "morts", "both". Default is "none". |
ddd |
a dataframe of stations/locations where detected movement between stations 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 be
considered a single residence event. Recommended to be the same as used
to 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 generate
residence events in |
season.start |
the start date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
season.end |
the end date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
season.overlap |
option to include residence events that overlap either the
beginning or the end of the period of interest. If |
morts.prev |
a dataframe containing potential mortalities. The dataframe must
have the same columns and in the same order as |
verbose |
option to display updates and progress bars as sub-functions are called and run. Default is TRUE. |
season |
a dataframe with start and end dates of the season(s) of interest |
a dataframe with one row for each tag ID, including the date/time of the 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 the input data) will be retained.
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)
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, with the option of plotting identified mortalities. Plotting uses ggplot2. Interactive option also uses plotly.
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 )
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 )
data |
a dataframe of residence events. Residence events must include tag 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 must
have the same ID, station, res.start, res.end, and residences column names
as |
singles |
option to adjust the end times of residence events so single detection events are visible. Adjustment is for visualization purposes only and 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 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 the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
season.end |
the end date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format 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. |
a ggplot2 plot. Additional arguments (e.g., formatting axes,
legend, aes, manual colour scales) can be added as for any ggplot2 plot.
If interactive=TRUE
,
returns a plotly plot.
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) plot
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) plot
These are fabricated detection data to demonstrate the use of the review function.
data(new.data)
data(new.data)
A data frame with 35 rows (observations) and 3 variables.
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 are days, as indicated by the variable name (which is automatically generated by mort::residences())
Generate residence events from passive acoustic telemetry data.
residences(data, ID, station, datetime, cutoff, units, verbose = TRUE)
residences(data, ID, station, datetime, cutoff, units, verbose = TRUE)
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 to be 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. |
Note that a progress bar appears, based on how many of the unique tag IDs have been processed. There will be a delay both before the progress bar appears and after the progress bar has reached 100%, which may be substantial depending on the size of the telemetry dataset.
A data frame with one row for each residence event, including date/time of residence start, date/time of residence end, and duration of residence event. All input data fields (e.g., any name, location, or species information that was included with detection data) will be retained.
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)
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)
Find the maximum duration of a single residence in the dataset that occurred before a station change (i.e., the animal can be assumed to be alive)
resmax( data, ID, station, res.start, residences, stnchange, drift = FALSE, verbose = TRUE )
resmax( data, ID, station, res.start, residences, stnchange, drift = FALSE, verbose = TRUE )
data |
a dataframe of residence events. Residence events must include tag 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 most
recent station or location change. Must use the same column names as |
drift |
indicates if drift residence events should be included in determining the maximum residence duration |
verbose |
option to display progress bar as function is run. Default is TRUE. |
a dataframe with the residence information for the longest residence for each tag ID that occurred before the most recent station/location change.
# Identify most recent station change station.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)
# Identify most recent station change station.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)
Find the maximum duration that an animal spent at a single
station/location before a station change (i.e., the animal can be assumed
to be alive). Differs from resmax
in that the duration is cumulative -
the time of residence events and intervals between residence events are all
included, provided there are no intervening residence events at other
stations/locations.
resmaxcml( data, ID, station, res.start, res.end, residences, units, stnchange, verbose = TRUE )
resmaxcml( data, ID, station, res.start, res.end, residences, units, stnchange, verbose = TRUE )
data |
a dataframe of residence events. Residence events must include tag 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 most
recent station or location change. Must use the same column names as |
verbose |
option to display progress bar as function is run. Default is TRUE. |
a dataframe with the cumulative residence information for each period where an animal was consecutively detected at a single station/location. Records are only given for cumulative residences that occurred before the most recent station/location change (i.e., the animal can be assumed to be alive).
# Identify most recent station change station.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)
# Identify most recent station change station.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)
Uses new data to determine if an animal that was previously flagged as a mortality made a station/location change and may therefore be alive.
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 )
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 )
morts |
a dataframe with previously flagged mortalities. Format does
not need to match |
new.data |
a dataframe of new residence events (i.e., generated from
detection data that were not included in earlier |
old.data |
optional dataframe of residence events that were used
in earlier |
type |
the method used to generate the residence events. Options are
"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then user
must 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 column
in |
units |
optional units of the duration of the residence events in
|
ddd |
a dataframe of stations/locations where detected movement between stations 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 called functions are run. Default is TRUE. |
A dataframe with one row for each tag ID from morts
with a station/location change that was identified
in new.data
. The remaining fields will include the information for the
residence event that was identified as the station change, so the station
change can be verified by the user before removing the animal from morts
.
All input data fields (e.g., any name, location, or species information
that was included with the input data) will be retained.
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)
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, to be used to identify potential mortalities or expelled tags. Useful when animals show strong seasonal patterns in behaviour. For example, a reduction in movement during winter may be falsely identified as a mortality, or increase the threshold use to identify mortalities, which would then cause potential mortalities to be missed.
season( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", residences = "auto", units = "auto", season.start, season.end, overlap = TRUE, verbose = TRUE )
season( data, type = "mort", ID, station, res.start = "auto", res.end = "auto", residences = "auto", units = "auto", season.start, season.end, overlap = TRUE, verbose = TRUE )
data |
a dataframe of residence events. Residence events must include tag 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 user
must 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 the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
season.end |
the end date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
overlap |
option to include residence events that overlap either the
beginning or the end of the period of interest. If |
verbose |
option to display updates and progress bars as functions is run. Default is TRUE. |
a dataframe in the same format as the input data, with residence events limited to the period(s) of interest.
# Seasons in format dd-mm season.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:SS season.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)
# Seasons in format dd-mm season.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:SS season.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)
The year has been changed, due to the sensitive nature of the dataset. The years have been changed in the same manner as the detection dates, so the ice-free dates correspond to the dataset in the same way as the original dataset.
data(seasons)
data(seasons)
A data frame with 5 rows (years) and 2 variables.
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 the most recent station or location change from passive acoustic telemetry data.
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 )
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 )
data |
a dataframe of residence events. Residence events must include tag 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 user
must 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 identifying station changes. |
ddd |
a dataframe of stations/locations where detected movement between stations 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. Default is TRUE. |
a dataframe with one row for each tag ID, including the date/time of the residence start at the most recent station or location, the date/time of the residence end, and duration of the residence event. All input data fields (e.g., any name, location, or species information that was included with the input data) will be retained.
stn.change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name",verbose=FALSE) head(stn.change)
stn.change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name",verbose=FALSE) head(stn.change)