get_neighbors | R Documentation |
Get neighbors for idx-th observation, idx starts from 1
get_neighbors(gda_w, idx)
gda_w |
A Weight object |
idx |
A value indicates idx-th observation, idx start from 1 |
A numeric vector of the neighbor indices, which start from 1
## Not run:
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
queen_w <- queen_weights(guerry)
nbrs <- get_neighbors(queen_w, idx = 1)
cat("\nNeighbors of the 1-st observation are:", nbrs)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.