Description Usage Arguments Details Value Examples
Calculation of Euclidean or geographic distance. Based on an adaptation of
rdist.earth
in the fields
package.
Uses earth radius = 6378.388 km for great circle distance calculations.
1 | dist_cpp(loc1, loc2, geographic)
|
loc1 |
A two column matrix representing the longitude/latitude (i.e. x/y) coordinates of the first set of distances. |
loc2 |
A two column matrix representing the longitude/latitude (i.e. x/y) coordinates of the second set of distances (for pairwise distance matrix set loc1 = loc2). |
geographic |
If TRUE, calculate great circle distance. If FALSE, calculate Euclidean distance. |
Note that while this function is still available to users. It is not
actively used in the intkrige
function. Instead,
for user convenience, distances are calculated using distance
functions in the sp
package.
A matrix of pairwise distances between each combination of rows from loc1 and loc2 respectively.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.