distance_weights: Create a distance-based weights

Description Usage Arguments Value Examples

View source: R/weights.R

Description

Create a distance-based weights

Usage

1
2
3
4
5
6
7
8
distance_weights(
  geoda_obj,
  dist_thres,
  power = 1,
  is_inverse = FALSE,
  is_arc = FALSE,
  is_mile = TRUE
)

Arguments

geoda_obj

An instance of geoda

dist_thres

A positive numeric value of distance threshold

power

(optional) The power (or exponent) of a number indicates how many times to use the number in a multiplication.

is_inverse

(optional) FALSE (default) or TRUE, apply inverse on distance value

is_arc

(optional) FALSE (default) or TRUE, compute arc distance between two observations

is_mile

(optional) TRUE (default) or FALSE, convert distance unit from mile to km.

Value

w An instance of GeoDaWeight

Examples

1
2
3
4
5
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)

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