kernel,GVector-method | R Documentation |
kernel()
creates a raster using a kernel density estimator of the density of points in a "points" GVector
.
## S4 method for signature 'GVector'
kernel(x, y, kernel = "Epanechnikov", optimize = TRUE, h = NULL)
x |
A "points" |
y |
A |
kernel |
Character: Name of the kernel function to use. Possible values include:
Partial matching is used, and case is ignored. |
optimize |
Logical: If |
h |
Numeric or If this is
If the Gaussian kernel is used, and Otherwise, if |
A GRaster
.
GRASS manual page for module v.kernel
(see grassHelp("v.kernel")
)
if (grassStarted()) {
# Setup
library(sf)
library(terra)
# Elevation raster, plant specimen collections, rivers vector,
# outline of area vector
madElev <- fastData("madElev")
madDypsis <- fastData("madDypsis")
# Convert to fasterRaster format:
elev <- fast(madElev)
dypsis <- fast(madDypsis)
# Kernel density estimation:
kde <- kernel(dypsis, elev)
plot(kde)
plot(dypsis, add = TRUE, pch = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.