View source: R/sits_geo_dist.R
sits_geo_dist | R Documentation |
Compute the minimum distances among samples and samples to prediction points, following the approach proposed by Meyer and Pebesma(2022).
sits_geo_dist(samples, roi, n = 1000L, crs = "EPSG:4326")
samples |
Time series (tibble of class "sits"). |
roi |
A region of interest (ROI), either a file containing a shapefile or an "sf" object |
n |
Maximum number of samples to consider (integer) |
crs |
CRS of the |
A tibble with sample-to-sample and sample-to-prediction distances (object of class "distances").
Alber Sanchez, alber.ipia@inpe.br
Rolf Simoes, rolf.simoes@inpe.br
Felipe Carvalho, felipe.carvalho@inpe.br
Gilberto Camara, gilberto.camara@inpe.br
Meyer, H., Pebesma, E. "Machine learning-based global maps of ecological variables and the challenge of assessing them", Nature Communications 13, 2208 (2022). https://doi.org/10.1038/s41467-022-29838-9
if (sits_run_examples()) {
# read a shapefile for the state of Mato Grosso, Brazil
mt_shp <- system.file("extdata/shapefiles/mato_grosso/mt.shp",
package = "sits"
)
# convert to an sf object
mt_sf <- sf::read_sf(mt_shp)
# calculate sample-to-sample and sample-to-prediction distances
distances <- sits_geo_dist(
samples = samples_modis_ndvi,
roi = mt_sf
)
# plot sample-to-sample and sample-to-prediction distances
plot(distances)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.