kde.polys: Kernel Density Estimates

Kernel Density Estimates From PointsR Documentation

Kernel Density Estimates

Description

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

Usage

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

Arguments

pts

A SpatialPoints or SpatialPointsDataFrame object or sf - POINT 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, Binbin Lu

Examples

  
# 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)
  

GISTools documentation built on Oct. 3, 2024, 1:08 a.m.