set_neighbors: Set neighbors of an observation

View source: R/weights.R

set_neighborsR Documentation

Set neighbors of an observation

Description

Set neighbors for idx-th observation, idx starts from 1

Usage

set_neighbors(gda_w, idx, nbrs)

Arguments

gda_w

A Weight object

idx

A value indicates idx-th observation, idx start from 1

nbrs

A list indicates the neighbors of idx-th observation (id start from 1)

Examples

## Not run: 
new_w <- create_weights(10)
set_neighbors(new_w, 1, c(2,3))
update_weights(new_w)

## End(Not run)

GeoDaCenter/rgeoda documentation built on Dec. 20, 2024, 11:18 p.m.