View source: R/spatial_functions.R
st_dist_rcpp | R Documentation |
st_distance
RcppParallel version of st_distance
st_dist_rcpp(x, y = x, unit = "mi")
x |
Object of class sf/sfc or a matrix of coordinates. If a
matrix of coordinates, use column order from |
y |
Optional. Object of class sf/sfc or a matrix of coordinates. If a
matrix of coordinates, use column order from |
unit |
Either "mi", "km", or "m". Sets the output distance. |
Matrix of distances of dimension n_x by n_y.
library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
st_dist_rcpp(nc[1:3,])
nc_long <- nc[rep(seq_len(nrow(nc)), 5), ]
sf::st_distance(nc_long)
st_dist_rcpp(nc_long)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.