get_neighbors_weights {rgeoda} | R Documentation |
Weights values of the neighbors of one observation
Description
Get the associated weights values of neighbors for idx-th observation
Usage
get_neighbors_weights(gda_w, idx)
Arguments
gda_w |
A Weight object |
idx |
A value indicates idx-th observation, idx start from 1 |
Value
A numeric vector of the neighbor indices, which start from 1
Examples
## Not run:
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
queen_w <- queen_weights(guerry)
nbrs <- get_neighbors_weights(queen_w, idx = 1)
cat("\nNeighbors of the 1-st observation are:", nbrs)
## End(Not run)
[Package rgeoda version 0.0.10-4 Index]