View source: R/NonResidenceExtractId.R
NonResidenceExtractId | R Documentation |
This function creates a nonresidences
data frame from a residences
event data frame and a optional distance matrix (sDistanceMatrix
). This function is not mandatory as it is carried out automatically if the user provides a distance matrix in the sDistanceMatrix
field when running the RunResidenceExtraction
function.
NonResidenceExtractId(sResidenceEventFile, sDistanceMatrix = NULL)
sResidenceEventFile |
a residence event table |
sDistanceMatrix |
an optional two dimentional array (matrix) containing the pairwise distances between a series of receivers |
STARTTIME |
a POSIXct vector object containing the date and time a transmitter left a receiver/station after a residence event |
ENDTIME |
a POSIXct vector object containing the date and time a transmitter arrived at a receiver/station and a new residence event was logged |
NONRESIDENCEEVENT |
a numeric vector indexing each nonresidence event |
TRANSMITTERID |
a numeric or character vector indexing the transmitter from which nonresidence events were determined |
RECEIVERID1 |
a numeric or character vector indexing the receiver which the transmitter initially moved from. If |
RECEIVERID2 |
a numeric or character vector indexing the receiver which the transmitter moved to. If |
DURATION |
a numeric vector containing the total time in seconds taken for the transmitter to move between two receivers or stations |
DISTANCE |
a numeric vector containing the minimum distance travelled in meters between two receivers/stations according to the distance matrix. If a distance matrix was not attached ( |
ROM |
a numeric vector containing the rate of movement ( |
Ross Dwyer, Mathew Watts, Hamish Campbell
RunResidenceExtraction
# This function runs within the RunResidenceExtraction function when
# a distance matrix is provided by the user.
# Extract residence events at RECEIVERS from the VTrack-transformed
# saltwater crocodile archive
# Load the crocodile data into the VTrack archive
data(crocs)
Vcrocs <- ReadInputData(infile=crocs,
iHoursToAdd=10,
dateformat = NULL,
sVemcoFormat='1.0')
# Extract data for only the transmitter #139
T139 <- ExtractData(Vcrocs,
sQueryTransmitterList = 139)
# Extract residence and non residence events using receiver data
# Minimum number of detections to register as a residence
# event = 2
# Min time period between detections before residence event
# recorded = 43200 secs (12 hours)
#T139Res <- RunResidenceExtraction(sInputFile=T139,
# sLocation="RECEIVERID",
# iResidenceThreshold=1,
# iTimeThreshold=43200,
# sDistanceMatrix=NULL)
# The residences event table
#T139resid <- T139Res$residences
# Generate the circuitous distance matrix
#data(PointsCircuitous_crocs)
#CircuitousDM <- GenerateCircuitousDistance(PointsCircuitous_crocs)
# Ensure there is only 1 Transmitter in dataset (if not, run the function within a loop)
#length(unique(T139resid$TRANSMITTERID))
# Run the non-residence function
#NonResidenceExtractId(sResidenceEventFile=T139resid,
# sDistanceMatrix=CircuitousDM)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.