save_weights: Save current spatial weights to a file

Description Usage Arguments Value Examples

View source: R/weights.R

Description

Save current spatial weights to a file

Usage

1
save_weights(gda_w, out_path, layer_name, id_name, id_values)

Arguments

gda_w

A Weight object

out_path

The path of an output weights file

layer_name

The name of the layer of input dataset

id_name

The id name (or field name), which is an associated column contains unique values, that makes sure that the weights are connected to the correct observations in the data table.

id_values

The tuple of values of selected id_name (column or field)

Value

Boolean value indicates if save successfully or failed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- geoda_open(guerry_path)
queen_w <- queen_weights(guerry)
save_weights(rook_w, out_path = '/Users/xun/Downloads/Guerry_r.gal', 
            layer_name = 'Guerry', 
            id_name = 'CODE_DE', 
            id_values = as.integer(guerry_df['CODE_DE'][,1]))

## End(Not run)

lixun910/rgeoda documentation built on March 19, 2021, 3:49 p.m.