m_surr_cbl: A funcion for creating m-surroudings from polygonal features...

Description Usage Arguments Details Value Examples

View source: R/m_surr_cbl.R

Description

This function obtains the m-surroundings by choosing the m-1 neighboring polygons. If there are more than (m-1) first order neighbors the algorithm chooses the polygons with the longest borderlines. **VIP** If there are less than (m-1) first order neighbors the corresponding m-surrounding is filled with second order neighbors in increasing order between centroid distances.

Usage

1
m_surr_cbl(x = x, m = m, control = NULL)

Arguments

x

input sf object with polygons or multipolygons features

m

length of m-surrounding

r

maximum overlap between any two m-surroundings

control

Argumento opcional. Por definir

Details

AquĆ­ Antonio escribe una linda historia

Value

REPASAR A list with four matrices: an m-surrounding matrix, named ms, whose rows correspond to the m-surroundings; a matrix, named msr, containing the m-surroundings with maximum overlapping of r; a matrix including the length of borderlines between m-surroundings and a distance matrix, named mdtms, whose rows correspond to distance between the elements of m-surroundings.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(sf)
fname <- system.file("shape/nc.shp", package="sf")
nc <- st_read(fname)
plot(sf::st_geometry(nc))
# VIP: THE THRESHOLD OF THE DISTANCE NEED TO BE VERY SMALL TO
# FIND M-SURROUNDINGS EXCEDING THE THRESHOLD.
lms3 <- m_surr_cbl(nc, m = 3, r = 1, control = list(dtmaxpc = 0.05))
lms5 <- m_surr_cbl(nc, m = 5, r = 2, control = list(dtmaxpc = 0.1))
dim(lms3$ms); dim(lms5$ms)
# m-surroundings or m-histories
 lms3$ms[1:5, ]; lms5$ms[1:5, ]
# length between borderlines in m-surroundings
lms3$mscbl[1:5, ]; lms5$mscbl[1:3, ]
# Distances in m-surroundings
lms3$mdtms[1:5,]; lms5$mdtms[1:5,]

rominsal/spqdata documentation built on Jan. 24, 2021, 11:11 a.m.