
Create a distance-based weights
distance_weights(
geoda_obj,
dist_thres,
power = 1,
is_inverse = FALSE,
is_arc = FALSE,
is_mile = TRUE
)
An instance of geoda-class
A positive numeric value of distance threshold
(optional) The power (or exponent) of a number indicates how many times to use the number in a multiplication.
(optional) FALSE (default) or TRUE, apply inverse on distance value
(optional) FALSE (default) or TRUE, compute arc distance between two observations
(optional) TRUE (default) or FALSE, convert distance unit from mile to km.
An instance of Weight-class
# NOT RUN {
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- geoda_open(guerry_path)
dist_thres <- min_distthreshold(guerry)
dist_w <- distance_weights(guerry, dist_thres)
summary(dist_w)
# }
Run the code above in your browser using DataLab