View source: R/weights-kernel.R
st_kernel_weights | R Documentation |
Create a weights list using a kernel function.
st_kernel_weights(
nb,
geometry,
kernel = "uniform",
threshold = critical_threshold(geometry),
adaptive = FALSE,
self_kernel = FALSE
)
nb |
an object of class |
geometry |
the geometry an sf object. |
kernel |
One of "uniform", "gaussian", "triangular", "epanechnikov", or "quartic". See kernels for more. |
threshold |
a scaling threshold to be used in calculating |
adaptive |
default |
self_kernel |
default |
By default st_kernel_weight()
utilizes a critical threshold of the maximum neighbor distance using critical_threshold()
. If desired, the critical threshold can be specified manually. The threshold
will be passed to the underlying kernel.
a list where each element is a numeric vector.
Other weights:
st_inverse_distance()
,
st_nb_dists()
,
st_weights()
geometry <- sf::st_geometry(guerry)
nb <- st_contiguity(geometry)
nb <- include_self(nb)
res <- st_kernel_weights(nb, geometry)
head(res, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.