R/st_nb_band.R

Defines functions st_nb_band

Documented in st_nb_band

#' Neighbors from a distance band
#'
#' Creates neighbors based on a distance band.
#'
#' @param x An sf or sfc object.
#' @param lower The lower threshold of the distance band. It is recommended to keep this as 0.
#' @param upper The upper threshold of the distance band.
#' @param ... Passed to `spdep::dnearneigh()`.
#' @family neighbors
#' @export
st_nb_band <- function(x, lower = 0, upper = .01, ...) {
  unclass(spdep::dnearneigh(x, lower, upper, ...))
}
JosiahParry/sfweight documentation built on April 4, 2022, 1:52 a.m.