Movatterモバイル変換


[0]ホーム

URL:


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 SmithORCID iD [aut, cre, cph], Heidi Swanson [fnd]
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 asdata.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt iftype="manual".

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 asdata.

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:


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:


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 indata.Options are "mort", "actel", "glatos", "vtrack", or "manual". If "manual", thenuser must specifyID,station,res.start, andres.end.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

residences

a character string with the name of the column indatathat holds the duration of the residence events.

units

units of the duration of the residence events indata.

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 indata that containsthe station/location names where drifting detections may start from.

to.station

a string of the name of the column indata that containsthe station/location names where drifting detections may move to.

cutoff

the maximum allowable time difference between detections to beconsidered a single residence event. Default isNULL.

cutoff.units

the units of the cutoff. Options are "secs", "mins", "hours","days", and "weeks".

verbose

option to display progress bar asdrift is applied.Default is TRUE.

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:


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 specifyID,station,res.start,res.end,residences, andunits.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

residences

residences a character string with the name of the column indatathat holds the duration of the residence events.

units

Units of the duration of the residence events indata. Options are "secs","mins", "hours", "days", and "weeks".

method

a character string of the threshold method. Options are "recent"and "defined". If "recent", must specifyrecent.period andrecent.units.If "defined", must specifystart andend.

threshold

the minimum summed duration of residence events for an animalto be considered alive. Units must be the same as the units ofresidences.

threshold.units

the units ofthreshold. Options are "secs","mins", "hours", "days", and "weeks". IfNULL, assumed to be the same asunits.

recent.period

the length of the period of time in which an animal mustbe detected longer than thethreshold to be considered alive. The periodends with the most recent detection of a given animal.

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 ifmethod="defined". Must be in the formatYYYY-mm-dd HH:MM:SS. The time zone is the same asres.start orassumed to be UTC if no time zone is defined forres.start.

end

character string with the end of the user-defined time period to search for infrequentdetections ifmethod="defined". Must be in the formatYYYY-mm-dd HH:MM:SS. The time zone is the same asres.start orassumed to be UTC if no time zone is defined forres.start.

morts.prev

a dataframe containing potential mortalities. The dataframe musthave the same columns and in the same order asdata.

replace

ifmorts specified and an animal with infrequent detectionsis already inmorts, the record inmorts will be replaced ifTRUE.Default isFALSE.

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 inddd that containsthe station/location names where drifting detections may start from. Mustbe identical to the station/location names indata.

to.station

a string of the name of the column inddd that containsthe station/location names where drifting detections may move to. Mustbe identical to the station/location names indata.

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 indata.

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 indata.

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 specifyID,station,res.start,res.end,residences, andunits.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

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 indata.

residences

a character string with the name of the column indatathat holds the duration of the residence events.

singles

specifies if single detections (length of residence event = 0)should be retained. Default isTRUE. Note that if single detections areremoved (singles=FALSE),backwards will also not include single detections.

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 ifbackwards=TRUE, then the output ofmethod="last" isthe same asmethod="any".

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 inddd that containsthe station/location names where drifting detections may start from. Mustbe identical to the station/location names indata.

to.station

a string of the name of the column inddd that containsthe station/location names where drifting detections may move to. Mustbe identical to the station/location names indata.

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 indata.

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 indata.

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. IfTRUE, the full overlappingresidence events will be retained. IfFALSE, only the portion of theresidence events that is within the period of interest will be retained,andresidences will be recalculated, using specifiedunits.Default isTRUE

morts.prev

a dataframe containing potential mortalities. The dataframe musthave the same columns and in the same order asdata.

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 indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

morts

a dataframe containing potential mortalities. The dataframe musthave the same ID, station, res.start, res.end, and residences column namesasdata.

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 columnindata that holds the duration of the residence events. Required ifgenerating an interactive plot or applying season.

units

units of the duration of the residence events indata.Required if applying season.

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. IfTRUE, thenseason.startandseason.end must be provided.

facet.axis

option to position facets along x or y axis. Options are"x" and "y". Default is "x". Note thatfacet.axis can only be "y" iffacet.by="year".

facet.by

option to facet by "season" (as defined withseason.startandseason.end) or "year". Default is "season".

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)plot

Example 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:


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 indata that holds the tag or sample IDs.

station

a string of the name of the column indata that holds the station name or receiver location.

datetime

a string of the name of the column indata that holds the date and time.

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 indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt iftype="manual".

residences

a character string with the name of the column indatathat holds the duration of the residence events.

stnchange

a dataframe with the start time and location of the mostrecent station or location change. Must use the same column names asdata.

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 indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt iftype="manual".

residences

a character string with the name of the column indatathat holds the duration of the residence events.

units

units of the duration of the residence events indata.

stnchange

a dataframe with the start time and location of the mostrecent station or location change. Must use the same column names asdata.

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 matchnew.data exactly, but the names and formats ofID,station,andres.start fields must match in all input dataframes.

new.data

a dataframe of new residence events (i.e., generated fromdetection data that were not included in earliermort analyses).

old.data

optional dataframe of residence events that were usedin earliermort analyses. Ifdrift was applied in earlier analyses,includingold.data is recommended to avoid falsely identifying stationchanges.

type

the method used to generate the residence events. Options are"mort", "actel", "glatos", "vtrack", or "manual". If "manual", then usermust specifyID,station,res.start,res.end,residences, andunits.

ID

a string of the name of the column inmorts andnew.data thatholds the tag or sample IDs.

station

a string of the name of the column inmorts andnew.datathat holds the station name or receiver location.

res.start

a string of the name of the column inmorts andnew.datathat holds the start date and time. Must be specified and in POSIXt orcharacter in the format YYYY-mm-dd HH:MM:SS.

res.end

an optional string of the name of the column inmorts and⁠new data⁠that holds the end date and time. Only needed if drift is applied.

residences

an optional character string with the name of the columninmorts andnew.data that holds the duration of the residence events.Only needed if drift is applied.

units

optional units of the duration of the residence events inmorts andnew.data. Only needed if drift is applied.

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 inddd that containsthe station/location names where drifting detections may start from. Mustbe identical to the station/location names inmorts andnew.data.

to.station

a string of the name of the column inddd that containsthe station/location names where drifting detections may move to. Mustbe identical to the station/location names inmorts andnew.data.

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 specifyres.start,res.end,residences, andunits.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

residences

a character string with the name of the column indatathat holds the duration of the residence events.

units

Units of the duration of the residence events indata. Options are "secs","mins", "hours", "days", and "weeks".

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. IfTRUE, the full overlappingresidence events will be retained. IfFALSE, only the portion of theresidence events that is within the period of interest will be retained,andresidences will be recalculated, using specifiedunits.Default isTRUE.

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:


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 specifyID,station,res.start, andresidences.

ID

a string of the name of the column indata that holds the tag orsample IDs.

station

a string of the name of the column indata that holds thestation name or receiver location.

res.start

a string of the name of the column indata that holds thestart date and time. Must be specified and in POSIXt iftype="manual".

res.end

a string of the name of the column indata that holds theend date and time. Must be specified and in POSIXt or character in the formatYYYY-mm-dd HH:MM:SS iftype="manual".

residences

a character string with the name of the column indatathat holds the duration of the residence events.

singles

specifies if single detections (length of residence event = 0)should be retained. Default isTRUE.

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 indata.Required ifdrift=TRUE. Options are "auto", or "secs", "mins", "hours", "days",or "weeks".

from.station

a string of the name of the column inddd that containsthe station/location names where drifting detections may start from. Mustbe identical to the station/location names indata.

to.station

a string of the name of the column inddd that containsthe station/location names where drifting detections may move to. Mustbe identical to the station/location names indata.

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)

[8]ページ先頭

©2009-2025 Movatter.jp