Learn R Programming

rgeoda (version 0.1.0)

set_neighbors_with_weights: Set neighbors and weights values of an observation

Description

Set neighbors and the associated weights values for idx-th observation, idx starts from 1

Usage

set_neighbors_with_weights(gda_w, idx, nbrs, wvals)

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)

wvals

A list indicates the associated weights values of the neighbors

Examples

Run this code
if (FALSE) {
new_w <- create_weights(10)
set_neighbors(new_w, 1, c(2,3))
update_weights(new_w)
}

Run the code above in your browser using DataLab