Learn R Programming

gdverse (version 1.1.0)

rgd: robust geographical detector(RGD) model

Description

Function for robust geographical detector(RGD) model.

Usage

rgd(formula, data, discvar = NULL, discnum = 3:22, minsize = 1, cores = 1)

Value

A list.

factor

the result of RGD model

disc

robust discrete results

Arguments

formula

A formula of RGD model.

data

A data.frame, tibble or sf object of observation data.

discvar

Name of continuous variable columns that need to be discretized. Noted that when formula has discvar, data must have these columns. By default, all independent variables are used as discvar.

discnum

A numeric vector of discretized classes of columns that need to be discretized. Default all discvar use 3:22.

minsize

(optional) The min size of each discretization group. Default all use 1.

cores

(optional) Positive integer (default is 1). When cores are greater than 1, use multi-core parallel computing.

References

Zhang, Z., Song, Y.*, & Wu, P., 2022. Robust geographical detector. International Journal of Applied Earth Observation and Geoinformation. 109, 102782. DOI: 10.1016/j.jag.2022.102782.

Examples

Run this code
if (FALSE) {
## The following code needs to configure the Python environment to run:
data('ndvi')
g = rgd(NDVIchange ~ ., data = ndvi,
        discvar = names(ndvi)[-1:-3],
        discnum = 3:8, cores = 6)
}

Run the code above in your browser using DataLab