Learn R Programming

simba (version 0.3-4)

direct: Obtain Direction Classes from Geographic Coordinates

Description

The functions calculates direction classes from geographic coordinates (not lat/lon). All possible connections between these points are established and the direction of each link is calculated. This is followed by a designation of direction-classes.

Usage

direct(coord, listout=FALSE)

direct2(coord, listout=FALSE)

Arguments

coord
A data.frame containing coordinates. Should have the same number of points as the data for which the direction-classes are calculated.
listout
Logical value, indicating whether the result is given back in (data.frame)-format instead of returning a dist-object.

Value

  • Returns a matrix containing the direction-classes of the connections between the coordinates as a dist-object. If listout = TRUE, the result is given as a list (data.frame). direct returns 4 directions (North-South, Northwest-Southeast, West-East, Northeast-Southwest). direct2 returns 6 directions.

encoding

UTF-8

See Also

mantel, cor.test

Examples

Run this code
data(abis)
dirclass <- direct(abis.env[,1:2])
dirclass
dirclass.ls <- direct(abis.env[,1:2], listout=TRUE)
dirclass.ls

Run the code above in your browser using DataLab