Install miniconda
Open the conda terminal and perform steps 3
to
6
Create a new conda env gdverse
conda create -n gdverse python=3.10 -y
Activate this env
conda activate gdverse
Install mamba
conda install -c conda-forge mamba -y
Set up python packages
mamba install -c conda-forge numpy joblib pandas ruptures -y
Configure GDVERSE_PYTHON
environment variable
Temporarily setting up gdverse
python dependence
environment using Sys.setenv()
in the R console or R code
like
Sys.setenv(GDVERSE_PYTHON = "path/to/python/environment")
.
Or using usethis::edit_r_environ()
to set
long-available gdverse
python dependencies environment
path.
ndvi_rgd = rgd(NDVIchange ~ ., data = ndvi,
discvar = names(dplyr::select(ndvi,-c(NDVIchange,Climatezone,Mining))),
discnum = 3:8, cores = 12)
ndvi_rgd
## *** Robust Geographical Detector
##
## | variable | Q-statistic | P-value |
## |:-------------:|:-----------:|:--------:|
## | Precipitation | 0.8883955 | 4.77e-10 |
## | Climatezone | 0.8218335 | 7.34e-10 |
## | Tempchange | 0.3722571 | 3.22e-10 |
## | Popdensity | 0.2480558 | 2.10e-10 |
## | GDP | 0.1491878 | 3.63e-10 |
## | Mining | 0.1411154 | 6.73e-10 |
##
## #### Only display the results corresponding to the maximum number of discretizations!
plot(ndvi_rgd)
RID
allows you to obtain the interactions of all
possible combinations of variables. By default,
Spatial Intersection
are used to generate a new spatial
partition of the interaction variables.
ndvi_rid = rid(NDVIchange ~ ., data = ndvi,
discvar = names(dplyr::select(ndvi,-c(NDVIchange,Climatezone,Mining))),
discnum = 8, cores = 12)
ndvi_rid
## *** Robust Interaction Detector
##
## | variable1 | variable2 | Interaction |
## |:-------------:|:-------------:|:------------:|
## | Climatezone | Mining | Enhance, bi- |
## | Climatezone | Tempchange | Enhance, bi- |
## | Climatezone | Precipitation | Enhance, bi- |
## | Climatezone | GDP | Enhance, bi- |
## | Climatezone | Popdensity | Enhance, bi- |
## | Mining | Tempchange | Enhance, bi- |
## | Mining | Precipitation | Enhance, bi- |
## | Mining | GDP | Enhance, bi- |
## | Mining | Popdensity | Enhance, bi- |
## | Tempchange | Precipitation | Enhance, bi- |
## | Tempchange | GDP | Enhance, bi- |
## | Tempchange | Popdensity | Enhance, bi- |
## | Precipitation | GDP | Enhance, bi- |
## | Precipitation | Popdensity | Enhance, bi- |
## | GDP | Popdensity | Enhance, bi- |
plot(ndvi_rid)