getDistance | R Documentation |
This function calculates the distance of two points in a grid.
getDistance(point.a, point.b, resolution=1)
point.a |
A point in a grid given by its row and column. |
point.b |
A point in a grid given by its row and column. |
resolution |
The resolution of the grid in (geographical) degree. |
This function calculates the distance of two points in a grid by the Pythagorean theorem.
The distance of the two points as an numeric value based on geographical degrees.
Maximilian Lange, Sven Lautenbach
##initialize data
point.a <- c(5,8)
point.b <- c(10,3)
##calculate the distance of the two points
distance <- getDistance(point.a,point.b, resolution=1)
print(distance)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.