Movatterモバイル変換


[0]ホーム

URL:


Digging into your data

All the functionality of the morts package is accessible with theresidences(),morts(),infrequent(),mortsplot(), andreview() functions, addressed in the other vignettes. Manyof these functions rely on output from additional functions. As you areexploring your data, you may want to run these additional functions tobetter dig through and understand your data. Thedrift()andseason() functions are respectively addressed in theDriftandSeasonalityvignettes. Here, we address thestationchange(),resmax(), andresmaxcml() functions.

stationchange() function

The thresholds inmorts() rely on identifying the mostrecent station or location change of each animal, because it is assumedthat the animal was alive before this most recent movement. To explorethe most recent station changes for each animal, the user can can callstationchange() directly. The arguments are used in thesame manner as formorts(). Drift may also be applied withthe argumentdrift=TRUE. See theDriftvignette for more information on the other drift arguments.

station_change<-stationchange(data=events,type="mort",ID="ID",station="Station.Name",drift=TRUE,ddd=ddd,units="days",from.station="From",to.station="To")

The output ofstationchange() is a dataframe with onerow for each animal ID. The residence event information (start, end,duration) is for the event that marks the most recent station change(i.e., the start is when the movement occurred).

ResidenceStartStation.NameIDResidenceEndResidenceLength.days
2005-06-25 21:26:1210A2005-06-26 09:01:170.4826968
2005-07-01 05:28:311B2005-07-01 05:28:310.0000000
2004-06-19 15:31:479C2004-06-19 19:10:010.1515509
2004-08-31 16:48:005D2004-08-31 17:38:180.0349306
2004-07-15 21:09:225E2004-10-12 21:44:1189.0241782
2005-06-28 21:12:581F2005-10-09 20:28:05102.9688310

resmax() function

The threshold formorts() whenmethod is“last”, “any”, or “all” is determined by identifying the longestresidence event that occurred before a station change. If there are someanimals with very long resident events that are not identified aspotential mortalities bymorts(), you may want to look atthe longest living residence events to explore how the threshold isbeing identified. This can be done by calling theresmax()function directly.

Note thatstationchange() must be run beforehand, andthe output provided in the argumentstnchange.

If drift was applied in generating the residence events, thedrift argument specifies whether drift events should beincluded inresmax(). If drift was not applied or ifdrift="morts" inmorts(), then you shouldincludedrift=FALSE. Ifdrift="threshold" ordrift="both" inmorts(), then you shouldincludedrift=TRUE. See theDriftvignette for more information on applying drift.

The output ofresmax() is a dataframe with one row foreach animal ID. The residence event information is for the event thathas the longest duration and occurred before the most recent stationchange for that animal.

resmax_example<-resmax(data=events,ID="ID",station="Station.Name",res.start="ResidenceStart",residences="ResidenceLength.days",stnchange=station_change,drift=FALSE)
ResidenceStartStation.NameIDResidenceEndResidenceLength.days
2003-09-24 16:56:361A2003-10-11 17:15:4717.0133218
2003-09-13 13:25:384C2003-10-07 16:26:0624.1253241
2003-08-16 22:35:231G2003-08-18 12:05:201.5624653
2003-01-31 19:47:168I2003-02-06 18:59:345.9668750
2002-08-26 07:18:128J2002-08-26 22:01:000.6130556
2003-01-16 18:55:128K2003-02-08 16:31:2522.9001505

resmaxcml() function

The threshold formorts() when themethodis “cumulative” or “any” is determined by finding the longest cumulativeresidence event that occurred before a station change. Cumulativeresidence events are the length of time between when an animal was firstdetected at a station and when it was last detected at the same station,ignoring any gaps in detection. You may wish to explore the cumulativeresidence events that contribute to determining this threshold. This canbe done by calling theresmaxcml() function directly.

Note thatstationchange() must be run beforehand, andthe output provided in the argumentstnchange.

If you have applied drift by usingdrift="threshold" ordrift="both" inmorts(), then you should applydrift using thedrift() function and use the output as theinput for thedata argument inresmaxcml().See theDriftvignette for more information on applying drift.

resmaxcml_example<-resmaxcml(data=events,ID="ID",station="Station.Name",res.start="ResidenceStart",res.end="ResidenceEnd",residences="ResidenceLength.days",units="days",stnchange=station_change)

The output ofresmaxcml() is similar to that fromresmax(), except there is one row for each cumulativeresidence event (not just the longest event). This means that there maybe more than one row for each animal ID.

ResidenceStartStation.NameIDResidenceEndResidenceLength.days
2003-09-21 23:49:4511A2003-09-22 00:08:180.0128819 days
2003-09-22 00:20:281A2004-06-24 01:15:25276.0381597 days
2004-06-24 17:30:4214A2004-06-24 17:30:420.0000000 days
2004-06-24 20:37:188A2004-06-24 21:39:340.0432407 days
2004-06-25 05:48:342A2004-06-25 06:47:400.0410417 days
2004-06-26 04:49:3110A2004-07-01 07:41:365.1195023 days

[8]ページ先頭

©2009-2025 Movatter.jp