Description Usage Arguments Details Value Examples
Dist.WREG
calculates the distance between two points
defined by Latitude-Longitude coordinates in decimal degrees.
1 | Dist.WREG(Lat1, Long1, Lat2, Long2, method = 2)
|
Lat1 |
Latitude of the first point, in decimal degrees. |
Long1 |
Lonigtude of the first point, in decimal degrees. |
Lat2 |
Latitude of the second point, in decimal degrees. |
Long2 |
Longitude of the second point, in deceimal degrees. |
method |
Idicates which technique to use for distance calculation. See details. |
Dist.WREG
is capable of using two techniques to calculate
intersite distances. method==1
indicates that the "Nautical Mile"
approximation should be used. This is the function that is currently
employed by WREG v. 1.05. Each arcminute is equal to 1852 meters.
method==2
indicates that the Haversine approximation should be used.
Returns the distance between the two sites in miles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Import some example data
peakFQdir <- paste0(
file.path(system.file("exampleDirectory", package = "WREG"),
"pfqImport"))
gisFilePath <- file.path(peakFQdir, "pfqSiteInfo.txt")
importedData <- importPeakFQ(pfqPath = peakFQdir, gisFile = gisFilePath)
# For two sites, compute the inter-site distance
# Use the haversine approximation
intersiteDistance <- Dist.WREG(Lat1 = importedData$BasChars$Lat[1],
Long1 = importedData$BasChars$Lat[1],
Lat2 = importedData$BasChars$Lat[2],
Long2 = importedData$BasChars$Lat[2],
method = 2)
print(intersiteDistance)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.