kde.polys: Kernel Density Estimates

Description Usage Arguments Value Author(s) Examples

Description

Given a set of points, a bandwidth, a grid density and a frame, produce a kernel density estimate

Usage

1
kde.points(pts,h,n=200,lims=NULL)

Arguments

pts

A SpatialPoints or SpatialPointsDataFrame object.

h

A real number - the bandwidth of the KDE

n

An integer, the output grid density - ie result is nxn grid

lims

A spatial object - the KDE grid will cover this, if provided

Value

A SpatialPixelsDataFrame containing the KDE.

Author(s)

Chris Brunsdon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Data for New Haven to use in example
data(newhaven)
# Do the KDE
breach.dens = kde.points(breach,lims=tracts)
# Plot the result
level.plot(breach.dens)
# Block out the part outside the study area
masker = poly.outer(breach.dens,tracts,extend=100); add.masking(masker)
# Plot census tract boundaries
plot(tracts,add=TRUE)

Example output

Loading required package: maptools
Loading required package: sp
Checking rgeos availability: TRUE
Loading required package: RColorBrewer
Loading required package: MASS
Loading required package: rgeos
rgeos version: 0.3-23, (SVN revision 546)
 GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
 Linking to sp version: 1.2-3 
 Polygon checking: TRUE 

NOTE: rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files

GISTools documentation built on May 6, 2019, 1:09 a.m.