GenerateDirectDistance: Converts a Points File into a Distance Matrix Using Direct...

Description Usage Arguments Value Author(s) See Also Examples

Description

This function calculates the straight line distance between a set of geographical coordinates and generates a matrix containing the distances between each of the points (i.e. receivers) minus the detection radius.

Usage

1

Arguments

sPointsFile

a dataframe containing the LOCATION (i.e. the STATIONNAME or the RECEIVERID), the coordinates and the detection RADIUS in meters. This should be in the format LOCATION, LATITUDE, LONGITUDE, RADIUS

Value

a 2x2 matrix containing the pairwise direct DISTANCE between each LOCATION minus the detection RADIUS. Distances are returned in kilometers

Author(s)

Ross Dwyer, Mathew Watts, Hamish Campbell

See Also

GenerateCircuitousDistance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Load the points file
data(PointsDirect_crocs)
# Generate the direct distance matrix
DirectDM <- GenerateDirectDistance(PointsDirect_crocs)

# Now plot example of how direct distances between receivers were generated
# In this example there are no structural boundary preventing an individual from 
#   moving between receivers
par(mfrow=c(1,1),las=1,bty="l")
plot(PointsDirect_crocs$LONGITUDE,PointsDirect_crocs$LATITUDE,pch=10,cex=1,
     xlab="Longitude",ylab="Latitude")
for(i in 1:length(PointsDirect_crocs$LONGITUDE))
  {
   lines(PointsDirect_crocs$LONGITUDE[c(1,i)],PointsDirect_crocs$LATITUDE[c(1,i)],
         lwd=0.3,col="grey",lty=3)
   }
points(PointsDirect_crocs$LONGITUDE,PointsDirect_crocs$LATITUDE,pch=10,cex=1)

VTrack documentation built on May 2, 2019, 9:16 a.m.