Learn R Programming

geozoning (version 1.0.0)

MeanVarWPts: MeanVarWPts

Description

MeanVarWPts

Usage

MeanVarWPts(map, zone, w = NULL)

Arguments

map

object returned by function genMap

zone

SpatialPolygons defining a zone

w

weighting vector (default NULL)

Value

a list with components

mean

(weighted) mean of the within zone attribute value

var

(weighted) variance of the within zone attribute value

Details

computes (weighted) mean and variance of zone data

Examples

Run this code
# NOT RUN {
data(resZTest)
K=resZTest
Z=K$zonePolygone
data(mapTest)
MeanVarWPts(mapTest,Z[[1]])
# Weights are areas of the Voronoi polygons corresponding to data points
MeanVarWPts(mapTest,Z[[1]],mapTest$krigSurfVoronoi) #slightly different result
# }

Run the code above in your browser using DataLab