GenerateLeastCostDistance: Converts a Points File into a Distance Matrix Using an...

Description Usage Arguments Value Author(s) See Also Examples

Description

This function calculates the distance between a set of geographical coordinates and generates a matrix containing the distances between each of the points. In development.

Usage

1
GenerateLeastCostDistance(sPointsFile,sTransition)

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, X, Y, RADIUS. Note - in this beta version the code only works with Cartesian coordinate systems (i.e. meters not degrees)

sTransition

a Transition object generated from a RasterLayer using the gdistance R package

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

See Also

GenerateCircuitousDistance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#WaterRaster <- raster("wenlock raster UTM.tif") # Load the raster
#tr <- transition(WaterRaster, 
#                 transitionFunction = mean, 
#                 directions = 8) # Create a Transition object from the raster

# Load the points file
#data(PointsLeastCost_crocs)
# Generate the Least Cost distance matrix
#RasterDM <- GenerateLeastCostDistance(PointsLeastCost_crocs, 
#                                      tr)

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