Learn R Programming

sfdep (version 0.2.5)

find_xj: Identify xj values

Description

Find xj values given a numeric vector, x, and neighbors list, nb.

Usage

find_xj(x, nb)

Value

A list of length x where each element is a numeric vector with the same length as the corresponding element in nb.

Arguments

x

a vector of any class

nb

a nb object e.g. created by st_contiguity() or st_knn()

Examples

Run this code
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