Learn R Programming

geozoning (version 1.0.0)

calDistance: calDistance

Description

calDistance

Usage

calDistance(typedist = 1, tabVal = NULL, listZonePoint = NULL,
  zoneN = NULL, surfVoronoi = NULL, meanZone = NULL, pErr = 0.9)

Arguments

typedist

default value is 1, other values not implemented yet.

tabVal

SpatialPointsDataFrame, contains data points to be used for zoning (spatial coordinates plus attribute values) result of call to genMap

listZonePoint

list of indices of data points within zones, result of call to calNei

zoneN

zone neighborhood matrix (TRUE values on diagonal), result of call to calNei

surfVoronoi

vector of Voronoi polygon surfaces corresponding to all data points,result of call to genMap

meanZone

vector of average attribute values for all zones

pErr

error percentage for correcting distances

Value

a list with components

matDistance

matrix of real values, corresponding to heterogeneities between neighbour zones. All other values are set to 0.

matDistanceCorr

corrected distance matrix using pErr

cost

sum or errors obtained by replacing all data values within a zone by the zone mean value

Details

calculates matrix of heterogeneities between neighbour zones. max(sigmai2[i],(fxmean*pErr/100)^2) + max(sigmai2[j],(fymean*pErr/100)^2) + (fxmean-fymean)^2

Examples

Run this code
# NOT RUN {
# load test map with simulated data
data(mapTest)
# load zoning results from test file
data(resZTest)
K=resZTest
resD = calDistance(typedist=1,mapTest$krigData,K$listZonePoint,K$zoneN,
       mapTest$krigSurfVoronoi,K$meanZone,pErr=0.9)
# }

Run the code above in your browser using DataLab