powered by
Find xj values given a numeric vector, x, and neighbors list, nb.
xj
x
nb
find_xj(x, nb)
A list of length x where each element is a numeric vector with the same length as the corresponding element in nb.
a vector of any class
a nb object e.g. created by st_contiguity() or st_knn()
st_contiguity()
st_knn()
nb <- st_contiguity(sf::st_geometry(guerry)) xj <- find_xj(guerry$crime_prop, nb) xj[1:3]
Run the code above in your browser using DataLab