Description Usage Arguments Details Value Examples
This function obtains the m-surroundings by choosing the m-1 nearest centroids. If there are less than m-1 neighbors the corresponding m-surrounding is filled with NA's
1 | m_surr_cdt(x = x, m = m, r = r, control = NULL)
|
x |
input sf object with points/multipolygons geometry or matrix of spatial coordinates |
m |
length of m-surrounding |
r |
maximum overlap between any two m-surroundings |
control |
Argumento opcional. Por definir |
AquĆ Antonio escribe una linda historia
REPASAR A list with SOME matrices: an m-surrounding matrix, named ms, whose rows correspond to the m-surroundings and a distance matrix, named mdtms, whose rows correspond to distance between the elements of m-surroundings.....
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | N <- 1000
m = 5
r = 2
cx <- runif(N)
cy <- runif(N)
x <- cbind(cx,cy)
msurr_points <- m_surr_cdt(x = x, m = m, r = r,
control = list(dtmaxabs = 0.05))
ms <- msurr_points$ms
mdtms <- msurr_points$mdtms
dim(ms); dim(mdtms)
ms[1:10,]
mdtms[1:10,]
# Examples with multipolygons
library(sf)
fname <- system.file("shape/nc.shp", package="sf")
nc <- st_read(fname)
plot(sf::st_geometry(nc))
lms3 <- m_surr_cdt(nc, m = 3, r = 2,
control = list(dtmaxpc = 0.1))
lms5 <- m_surr_cdt(nc, m = 5, r = 1,
control = list(dtmaxpc = 0.1))
# m-surroundings or m-histories
lms3$ms[1:3, ]; lms5$ms[1:3, ]
# Distances in m-surroundings
lms3$mdtms[1:3,]; lms5$mdtms[1:3,]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.