Learn R Programming

spatialEco (version 0.1-7)

kde2D: 2-dimensional kernel density estimate

Description

Calculates kernel density estimate, over specified extent, and outputs a raster

Usage

kde2D(x, bw = NULL, n = 120, ext = NULL, standardize = FALSE)

Arguments

x
SpatialPoints of SpatialPointsDataFrame object
bw
Bandwidth of Gaussian Kernel
n
Number of rows and columns (evaluation points)
ext
Extent of raster, coordinates as: c(xmin, xmax, ymin, ymax)
standardize
Standardize results to 0-1 (FALSE/TRUE)

Value

A list object with: kde Raster class object of kernel density estimate bandwidth Bandwidth of kernel

Examples

Run this code
library(sp)
library(raster)
data(meuse)
coordinates(meuse) <- ~x+y

meuse.kde <- kde2D(meuse, bw = 1000, n = 500, standardize = TRUE)  

plot(meuse.kde$kde)
  plot(meuse, pch=20, cex=0.75, col="red", add=TRUE)				   

Run the code above in your browser using DataLab