kde | R Documentation |
KDE for spatial data. The algorithm is heavily inspired by Heatmap tool in QGIS. The help for QGIS tools is provided at the QGIS website. The a tutorial is provided here.
kde( points, band_width, decay = 1, kernel = c("quartic", "uniform", "triweight", "epanechnikov", "triangular"), scaled = FALSE, weights = c(), grid, cell_size, quiet = FALSE )
points |
|
band_width |
|
decay |
|
kernel |
|
scaled |
|
weights |
|
grid |
either |
cell_size |
|
quiet |
Should printing of progress bar be suppressed? Default 'FALSE'. |
grid
parameter specifies output of the function. KDE is calculated on the specified grid
.
If grid is Raster-class
then outcome is also Raster-class
.
If grid is sf
data.frame
then outcome is also sf
data.frame
.
either sf
data.frame
or Raster-class
depending on class of grid
parameter.
library(sf) nc <- st_read(system.file("shape/nc.shp", package = "sf")) %>% st_transform(32031) grid <- create_grid_hexagonal(nc, cell_size = 100000) points <- st_sample(nc, 500) %>% st_as_sf() kde_estimate_grid <- kde(points, band_width = 150000, grid = grid) raster <- create_raster(nc, cell_size = 100000) kde_estimate_raster <- kde(points, band_width = 150000, grid = raster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.