Learn R Programming

rgeoda (version 0.1.0)

save_weights: Save Spatial Weights

Description

Save spatial weights to a file

Usage

save_weights(gda_w, id_variable, out_path, layer_name = "")

Value

A boolean value indicates if save successfully or failed

Arguments

gda_w

A Weight object

id_variable

The id variable (a data.frame) that defines the unique value of each observation when saving a weights file

out_path

The path of an output weights file

layer_name

(optional) The name of the layer of input dataset

Examples

Run this code
if (FALSE) {
library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
queen_w <- queen_weights(guerry)
save_weights(quen_w, guerry_df['CODE_DE'], out_path = '/path/Guerry_r.gal')
}

Run the code above in your browser using DataLab