Learn R Programming

geozoning (version 1.0.0)

optiRG: optiRG join two zones close to each other

Description

optiRG join two zones close to each other

Usage

optiRG(K, map, iC, iZC, simplitol = 0.001, disp = 0)

Arguments

K

zoning object (such as returned by calNei function)

map

object returned by function genMap

iC

first zone

iZC

second zone

simplitol

tolerance for spatial polygons geometry simplification

disp

0: no info, 1: detailed info

Value

a zoning object

Details

Within a zoning, two zones close to each other are geometrically joined. The zoning is updated accordingly. If the zone resulting from the junction is not valid, i.e. if it crosses another zone, the function returns NULL.

Examples

Run this code
# NOT RUN {
data(mapTest)
qProb=c(0.2,0.5)
ZK = initialZoning(qProb, mapTest)
K=ZK$resZ
Z=K$zonePolygone
plotZ(K$zonePolygone) # zoning
kmi=optiRG(K,mapTest,6,7,disp=1)
#zones 6 and 7 are joined into new zone 6
sp::plot(kmi$zonePolygone[[6]],col="red",add=TRUE)
# }

Run the code above in your browser using DataLab