Learn R Programming

⚠️There's a newer version (1.3-3) of this package.Take me there.

gdverse

Analysis of Spatial Stratified Heterogeneity

Overview

Current models and functions provided by gdverse are:

geodetector modelgdverse functionsupport status
GDgd()✔️
OPGDopgd()✔️
GOZHgozh()✔️
LESHlesh()✔️
SPADEspade()✔️
IDSAidsa()✔️
RGDrgd()✔️
RIDrid()✔️
SRSGDsrsgd()✔️

Installation

  • Install from CRAN with:
install.packages("gdverse", dep = TRUE)
  • Install development binary version from R-universe with:
install.packages('gdverse',
                 repos = c("https://ausgis.r-universe.dev",
                           "https://cloud.r-project.org"),
                 dep = TRUE)
  • Install development source version from GitHub with:
# install.packages("devtools")
devtools::install_github("ausgis/gdverse",
                         build_vignettes = TRUE,
                         dep = TRUE)

Please ensure that Rcpp is properly installed and the appropriate C++ compilation environment is configured in advance if you want to install gdverse from github.

Example

library(gdverse)
data("ndvi")
ndvi
## # A tibble: 713 × 7
##    NDVIchange Climatezone Mining Tempchange Precipitation    GDP Popdensity
##         <dbl> <chr>       <fct>       <dbl>         <dbl>  <dbl>      <dbl>
##  1    0.116   Bwk         low         0.256          237.  12.6      1.45  
##  2    0.0178  Bwk         low         0.273          214.   2.69     0.801 
##  3    0.138   Bsk         low         0.302          449.  20.1     11.5   
##  4    0.00439 Bwk         low         0.383          213.   0        0.0462
##  5    0.00316 Bwk         low         0.357          205.   0        0.0748
##  6    0.00838 Bwk         low         0.338          201.   0        0.549 
##  7    0.0335  Bwk         low         0.296          210.  11.9      1.63  
##  8    0.0387  Bwk         low         0.230          236.  30.2      4.99  
##  9    0.0882  Bsk         low         0.214          342. 241       20.0   
## 10    0.0690  Bsk         low         0.245          379.  42.0      7.50  
## # ℹ 703 more rows

OPGD model

discvar = names(ndvi)[-1:-3]
discvar
## [1] "Tempchange"    "Precipitation" "GDP"           "Popdensity"
ndvi_opgd = opgd(NDVIchange ~ ., data = ndvi, 
                 discvar = discvar, cores = 6)
ndvi_opgd
##                 OPGD Model                  
## ***          Factor Detector            
## 
## |   variable    | Q-statistic | P-value  |
## |:-------------:|:-----------:|:--------:|
## | Precipitation |  0.8842705  | 8.58e-10 |
## |  Climatezone  |  0.8218335  | 7.34e-10 |
## |  Tempchange   |  0.3618595  | 3.31e-10 |
## |  Popdensity   |  0.2203510  | 9.65e-10 |
## |    Mining     |  0.1411154  | 6.73e-10 |
## |      GDP      |  0.1270466  | 2.00e-09 |

GOZH model

g = gozh(NDVIchange ~ ., data = ndvi)
g
##                 GOZH Model                  
## ***          Factor Detector            
## 
## |   variable    | Q-statistic | P-value  |
## |:-------------:|:-----------:|:--------:|
## | Precipitation | 0.87255056  | 4.52e-10 |
## |  Climatezone  | 0.82129550  | 2.50e-10 |
## |  Tempchange   | 0.33324945  | 1.12e-10 |
## |  Popdensity   | 0.22321863  | 3.00e-10 |
## |    Mining     | 0.13982859  | 6.00e-11 |
## |      GDP      | 0.09170153  | 3.96e-10 |

Copy Link

Version

Install

install.packages('gdverse')

Monthly Downloads

338

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Wenbo Lv

Last Published

October 10th, 2024

Functions in gdverse (1.1.0)

opgd

optimal parameters-based geographical detector(OPGD) model
gozh

geographically optimal zones-based heterogeneity(GOZH) model
pid_idsa

IDSA Q-saistics PID
plot.srs_interaction_detector

plot spatial rough set-based interaction detector result
plot.spade_result

plot SPADE power of spatial and multilevel discretization determinant
%>%

Pipe operator
plot.srs_factor_detector

plot spatial rough set-based factor detector result
plot.srs_ecological_detector

plot spatial rough set-based ecological detector
plot.gd_result

plot GD result
plot.opgd_result

plot OPGD result
print.interaction_detector

print interaction detector
plot.sesu_opgd

plot opgd sesu
plot.sesu_gozh

plot gozh sesu
print.lesh_result

print LESH model interaction result
plot.lesh_result

plot LESH model result
plot.gozh_result

plot GOZH result
plot.ecological_detector

plot ecological detector
print.srs_interaction_detector

print spatial rough set-based interaction detector
print.rgd_result

print RGD result
plot.factor_detector

plot factor detector result
print.srs_factor_detector

print spatial rough set-based factor detector
print.opgd_result

print OPGD result
plot.srsgd_result

plot SRSGD result
print.rid_result

print RID result
print.srsgd_result

print SRSGD result
psd_iev

PSD of an interaction of explanatory variables (PSD-IEV)
print.ecological_detector

print ecological detector
print.gozh_result

print GOZH result
print.idsa_result

print IDSA result
print.sesu_gozh

print gozh sesu
print.sesu_opgd

print opgd sesu
sesu_gozh

comparison of size effects of spatial units based on GOZH
rgd

robust geographical detector(RGD) model
rescale_vector

rescale continuous vector to specified minimum and maximum
sesu_opgd

comparison of size effects of spatial units based on OPGD
shuffle_vector

randomly shuffling vector
psmd_spade

power of spatial and multilevel discretization determinant(PSMD)
psd_pseudop

calculate power of spatial determinant(PSD) and the corresponding pseudo-p value
robust_disc

univariate discretization based on offline change point detection
rpart_disc

discretization of variables based on recursive partitioning
plot.idsa_result

plot IDSA risk result
print.risk_detector

print risk detector
psmd_pseudop

power of spatial and multilevel discretization determinant(PSMD) and the corresponding pseudo-p value
weight_assign

assign values by weight
psd_spade

power of spatial determinant(PSD)
srs_wt

example of spatial information system spatial adjacency matrix
sim

Simulation data.
plot.risk_detector

plot risk detector
srs_geodetector

spatial rough set-based geographical detector
srs_interaction_detector

spatial rough set-based interaction detector
plot.interaction_detector

plot interaction detector result
srs_ecological_detector

spatial rough set-based ecological detector
srs_factor_detector

spatial rough set-based factor detector
print.gd_result

print GD result
srs_table

example of spatial information system table
srsgd

spatial rough set-based geographical detector(SRSGD) model
print.srs_ecological_detector

print spatial rough set-based ecological detector
rid

robust interaction detector(RID) model
print.factor_detector

print factor detector
plot.rgd_result

plot RGD result
risk_detector

risk detector
print.spade_result

print SPADE power of spatial and multilevel discretization determinant
spade

spatial association detector (SPADE) model
spd_lesh

SHAP power of determinants (SPD)
F_informationloss

measure information loss by information entropy
gd_bestunidisc

best univariate discretization based on geodetector q-statistic
generate_subsets

generate subsets of a set
cpsd_spade

compensated power of spatial determinant(CPSD)
cpsd_disc

optimal spatial data discretization based on SPADE q-statistics
all2int

convert all discretized vectors to integer
NTDs

NTDs data
interaction_detector

interaction detector
factor_detector

factor detector
gd

native geographical detector(GD) model
ecological_detector

ecological detector
geodetector

geographical detector
ndvi

dataset of NDVI changes and its influencing factors
inverse_distance_weight

calculate inverse distance weight
idsa

interactive detector for spatial associations(IDSA) model
gozh_detector

geographically optimal zones-based heterogeneity detector
lesh

locally explained heterogeneity(LESH) model
loess_optscale

determine optimal spatial data analysis scale