From 7b20bec952cc8c130d667514b770aa147061ea0b Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Wed, 19 Jun 2024 05:28:23 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20SpatLyu/?= =?UTF-8?q?gdverse@6ef933402f282673ce351aad57aebf1a16007762=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgdown.yml | 2 +- reference/gd.html | 6 +++--- reference/index.html | 2 +- search.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgdown.yml b/pkgdown.yml index 890a7b4b..0270b34c 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: OPGD: OPGD.html RGD: RGD.html -last_built: 2024-06-19T05:21Z +last_built: 2024-06-19T05:28Z urls: reference: https://spatlyu.github.io/gdverse/reference article: https://spatlyu.github.io/gdverse/articles diff --git a/reference/gd.html b/reference/gd.html index 274ff8f9..ba88c020 100644 --- a/reference/gd.html +++ b/reference/gd.html @@ -1,5 +1,5 @@ -ordinary geographical detector model — gd • gdverseoriginal geographical detector model — gd • gdverse @@ -47,13 +47,13 @@
-

Function for ordinary geographical detector model.

+

Function for original geographical detector model.

diff --git a/reference/index.html b/reference/index.html index 81843030..9af17a65 100644 --- a/reference/index.html +++ b/reference/index.html @@ -75,7 +75,7 @@

All functionsgd() -
ordinary geographical detector model
+
original geographical detector model
gd_bestunidisc() diff --git a/search.json b/search.json index 7f5745b7..76129cb2 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"load-data-and-package","dir":"Articles","previous_headings":"","what":"Load data and package","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"library(terra) library(tidyverse) library(gdverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = aggregate(fvc,fact = 5) fvc ## class : SpatRaster ## dimensions : 84, 114, 13 (nrow, ncol, nlyr) ## resolution : 5000, 5000 (x, y) ## extent : -92742.16, 477257.8, 3589385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source(s) : memory ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1527159, 111.2089, 2.340401, 3834.887, 10.92638, -9.976424, ... ## max values : 0.8905939, 247.1408, 75.933422, 8276.911, 26.72104, 1.101411, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" \"ntl\" \"lulc\" ## [11] \"elev\" \"slope\" \"aspect\""},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"convert-data-from-spatraster-to-tibble","dir":"Articles","previous_headings":"","what":"Convert data from SpatRaster to tibble","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope aspect ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 122. ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 174. ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 192. ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 213. ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 132. ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 137."},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"determine-optimal-discretization-parameters","dir":"Articles","previous_headings":"","what":"Determine optimal discretization parameters","title":"Optimal Parameters Geographical Detector(OPGD)","text":"lulc discrete category variable fvc data, need discretize others. can use gd_bestunidisc() discretize based geodetector q-statistic. new.fvc discrete result optimal discretization parameter based Q statistic geographic detector,can combine fvc lulc col fvc tibble now.","code":"tictoc::tic() g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 3:15,cores = 6) tictoc::toc() ## 3.79 sec elapsed g ## $x ## [1] \"aspect\" \"elev\" \"ntl\" \"pop\" \"premax\" \"premin\" \"presum\" \"slope\" \"tmpavg\" \"tmpmax\" ## [11] \"tmpmin\" ## ## $k ## [1] 12 14 12 14 12 14 15 11 15 15 13 ## ## $method ## [1] \"pretty\" \"quantile\" \"fisher\" \"quantile\" \"fisher\" \"fisher\" \"fisher\" \"equal\" ## [9] \"fisher\" \"quantile\" \"fisher\" ## ## $disv ## # A tibble: 5,240 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 3 10 3 2 5 1 1 2 6 9 2 ## 2 4 9 4 4 5 1 1 2 7 11 2 ## 3 4 10 3 2 5 1 1 2 6 9 2 ## 4 5 11 2 2 6 1 1 3 5 7 2 ## 5 3 10 4 1 5 1 1 2 6 9 2 ## 6 3 9 4 1 5 1 1 2 7 11 2 ## 7 3 9 3 3 5 1 1 1 7 11 2 ## 8 5 9 4 2 5 1 1 2 7 11 2 ## 9 4 10 5 7 5 1 1 2 6 9 2 ## 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows new.fvc = g$disv new.fvc ## # A tibble: 5,240 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 3 10 3 2 5 1 1 2 6 9 2 ## 2 4 9 4 4 5 1 1 2 7 11 2 ## 3 4 10 3 2 5 1 1 2 6 9 2 ## 4 5 11 2 2 6 1 1 3 5 7 2 ## 5 3 10 4 1 5 1 1 2 6 9 2 ## 6 3 9 4 1 5 1 1 2 7 11 2 ## 7 3 9 3 3 5 1 1 1 7 11 2 ## 8 5 9 4 2 5 1 1 2 7 11 2 ## 9 4 10 5 7 5 1 1 2 6 9 2 ## 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 5,240 × 13 ## fvc lulc aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 0.188 10 3 10 3 2 5 1 1 2 6 9 2 ## 2 0.162 10 4 9 4 4 5 1 1 2 7 11 2 ## 3 0.168 10 4 10 3 2 5 1 1 2 6 9 2 ## 4 0.186 10 5 11 2 2 6 1 1 3 5 7 2 ## 5 0.189 10 3 10 4 1 5 1 1 2 6 9 2 ## 6 0.171 10 3 9 4 1 5 1 1 2 7 11 2 ## 7 0.153 10 3 9 3 3 5 1 1 1 7 11 2 ## 8 0.163 10 5 9 4 2 5 1 1 2 7 11 2 ## 9 0.176 10 4 10 5 7 5 1 1 2 6 9 2 ## 10 0.177 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows"},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"Optimal Parameters Geographical Detector(OPGD)","text":", can run geodetector model gd() function.","code":"gd(fvc ~ .,data = new.fvc,type = 'factor') ## Spatial Stratified Heterogeneity Test ## ## Factor detector gd(fvc ~ .,data = new.fvc,type = 'interaction') ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"you-can-also-use-opgd-in-one-time-to-get-result-above-","dir":"Articles","previous_headings":"","what":"You can also use opgd() in one time to get result above.","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"fvc_opgd = opgd(fvc ~ ., data = fvc, discnum = 3:15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = c('factor','interaction')) str(fvc_opgd) ## List of 2 ## $ :List of 1 ## ..$ factor: tibble [12 × 3] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable : chr [1:12] \"presum\" \"lulc\" \"premin\" \"tmpmin\" ... ## .. ..$ Q-statistic: num [1:12] 0.663 0.66 0.465 0.428 0.254 ... ## .. ..$ P-value : num [1:12] 9.15e-10 8.78e-10 4.83e-10 5.54e-10 7.85e-10 ... ## ..- attr(*, \"class\")= chr \"factor_detector\" ## $ :List of 1 ## ..$ interaction: tibble [66 × 6] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable1 : chr [1:66] \"lulc\" \"lulc\" \"lulc\" \"lulc\" ... ## .. ..$ variable2 : chr [1:66] \"aspect\" \"elev\" \"ntl\" \"pop\" ... ## .. ..$ Interaction : chr [1:66] \"Enhance, nonlinear\" \"Enhance, bi-\" \"Enhance, nonlinear\" \"Enhance, bi-\" ... ## .. ..$ Variable1 Q-statistics : num [1:66] 0.66 0.66 0.66 0.66 0.66 ... ## .. ..$ Variable2 Q-statistics : num [1:66] 0.0118 0.2318 0.0225 0.1896 0.1417 ... ## .. ..$ Variable1 and Variable2 interact Q-statistics: num [1:66] 0.683 0.82 0.724 0.754 0.769 ... ## ..- attr(*, \"class\")= chr \"interaction_detector\" fvc_opgd[[1]] ## Spatial Stratified Heterogeneity Test ## ## Factor detector fvc_opgd[[2]] ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"set-up-your-python-dependence","dir":"Articles","previous_headings":"","what":"Set up your python dependence","title":"Robust Geographical Detector(RGD)","text":"install miniconda create new conda env geocompy use conda create -n geocompy python=3.9 -y activate env conda activate geocompy install mamba conda install -c conda-forge mamba -y. set python packages use mamba install -c conda-forge numpy==1.23.5 joblib pandas ruptures -y","code":""},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"load-data-and-package","dir":"Articles","previous_headings":"","what":"Load data and package","title":"Robust Geographical Detector(RGD)","text":"","code":"library(terra) ## terra 1.7.78 library(tidyverse) ## ── Attaching core tidyverse packages ─────────────────────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1 ## ✔ purrr 1.0.2 ## ── Conflicts ───────────────────────────────────────────────────────── tidyverse_conflicts() ── ## ✖ tidyr::extract() masks terra::extract() ## ✖ dplyr::filter() masks gdverse::filter(), stats::filter() ## ✖ dplyr::lag() masks stats::lag() ## ℹ Use the conflicted package () to force all conflicts to become errors library(gdverse) reticulate::use_condaenv('geocompy') fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = aggregate(fvc,fact = 5) fvc ## class : SpatRaster ## dimensions : 84, 114, 13 (nrow, ncol, nlyr) ## resolution : 5000, 5000 (x, y) ## extent : -92742.16, 477257.8, 3589385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source(s) : memory ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1527159, 111.2089, 2.340401, 3834.887, 10.92638, -9.976424, ... ## max values : 0.8905939, 247.1408, 75.933422, 8276.911, 26.72104, 1.101411, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" \"ntl\" \"lulc\" ## [11] \"elev\" \"slope\" \"aspect\""},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"convert-data-from-spatraster-to-tibble","dir":"Articles","previous_headings":"","what":"Convert data from SpatRaster to tibble","title":"Robust Geographical Detector(RGD)","text":"","code":"fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope aspect ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 122. ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 174. ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 192. ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 213. ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 132. ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 137."},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"determine-discretization-use-offline-change-point-detection","dir":"Articles","previous_headings":"","what":"Determine discretization use offline change point detection","title":"Robust Geographical Detector(RGD)","text":"lulc discrete category variable fvc data, need discretize others. can use robust_disc() discretize based offline change point detection. new.fvc discrete result,can combine fvc lulc col fvc tibble now.","code":"tictoc::tic() new.fvc = robust_disc(fvc ~ .,data = select(fvc,-lulc),discnum = 15,cores = 6) tictoc::toc() ## 2595.78 sec elapsed new.fvc ## # A tibble: 5,240 × 11 ## premax premin presum tmpmax tmpmin tmpavg pop ntl elev slope aspect ## ## 1 group10 group1 group1 group8 group4 group5 group7 group14 group13 group10 group4 ## 2 group10 group1 group1 group9 group4 group7 group10 group14 group11 group10 group14 ## 3 group11 group1 group1 group8 group4 group5 group8 group14 group13 group10 group14 ## 4 group13 group1 group1 group8 group2 group4 group7 group14 group13 group11 group14 ## 5 group10 group1 group1 group8 group4 group5 group1 group14 group13 group10 group7 ## 6 group10 group1 group1 group9 group4 group5 group2 group14 group11 group10 group7 ## 7 group10 group1 group1 group9 group4 group7 group8 group14 group9 group6 group4 ## 8 group10 group1 group1 group9 group4 group7 group8 group14 group9 group10 group14 ## 9 group10 group1 group1 group8 group4 group5 group10 group14 group13 group10 group14 ## 10 group11 group1 group1 group8 group4 group5 group9 group14 group9 group10 group14 ## # ℹ 5,230 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 5,240 × 13 ## fvc lulc premax premin presum tmpmax tmpmin tmpavg pop ntl elev slope aspect ## ## 1 0.188 10 group10 group1 group1 group8 group4 group5 group7 group14 group13 group… group4 ## 2 0.162 10 group10 group1 group1 group9 group4 group7 group10 group14 group11 group… group… ## 3 0.168 10 group11 group1 group1 group8 group4 group5 group8 group14 group13 group… group… ## 4 0.186 10 group13 group1 group1 group8 group2 group4 group7 group14 group13 group… group… ## 5 0.189 10 group10 group1 group1 group8 group4 group5 group1 group14 group13 group… group7 ## 6 0.171 10 group10 group1 group1 group9 group4 group5 group2 group14 group11 group… group7 ## 7 0.153 10 group10 group1 group1 group9 group4 group7 group8 group14 group9 group6 group4 ## 8 0.163 10 group10 group1 group1 group9 group4 group7 group8 group14 group9 group… group… ## 9 0.176 10 group10 group1 group1 group8 group4 group5 group10 group14 group13 group… group… ## 10 0.177 10 group11 group1 group1 group8 group4 group5 group9 group14 group9 group… group… ## # ℹ 5,230 more rows"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"Robust Geographical Detector(RGD)","text":",can run geodetector model gd() function.","code":"gd(fvc ~ .,data = new.fvc,type = 'factor') ## Spatial Stratified Heterogeneity Test ## ## Factor detector gd(fvc ~ .,data = new.fvc,type = 'interaction') ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"you-can-also-use-rgd-in-one-time-to-get-result-above-","dir":"Articles","previous_headings":"","what":"You can also use rgd() in one time to get result above.","title":"Robust Geographical Detector(RGD)","text":"","code":"fvc_rgd = rgd(fvc ~ ., data = fvc, discnum = 15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = c('factor','interaction')) str(fvc_rgd) ## List of 2 ## $ :List of 1 ## ..$ factor: tibble [12 × 3] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable : chr [1:12] \"presum\" \"lulc\" \"premin\" \"tmpmin\" ... ## .. ..$ Q-statistic: num [1:12] 0.674 0.66 0.486 0.458 0.282 ... ## .. ..$ P-value : num [1:12] 6.17e-10 8.78e-10 5.46e-10 6.23e-10 5.85e-10 ... ## ..- attr(*, \"class\")= chr \"factor_detector\" ## $ :List of 1 ## ..$ interaction: tibble [66 × 6] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable1 : chr [1:66] \"lulc\" \"lulc\" \"lulc\" \"lulc\" ... ## .. ..$ variable2 : chr [1:66] \"premax\" \"premin\" \"presum\" \"tmpmax\" ... ## .. ..$ Interaction : chr [1:66] \"Enhance, bi-\" \"Enhance, bi-\" \"Enhance, bi-\" \"Enhance, bi-\" ... ## .. ..$ Variable1 Q-statistics : num [1:66] 0.66 0.66 0.66 0.66 0.66 ... ## .. ..$ Variable2 Q-statistics : num [1:66] 0.167 0.486 0.674 0.282 0.458 ... ## .. ..$ Variable1 and Variable2 interact Q-statistics: num [1:66] 0.771 0.791 0.817 0.82 0.848 ... ## ..- attr(*, \"class\")= chr \"interaction_detector\" fvc_rgd[[1]] ## Spatial Stratified Heterogeneity Test ## ## Factor detector fvc_rgd[[2]] ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Wenbo Lv. Author, maintainer.","code":""},{"path":"https://spatlyu.github.io/gdverse/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lv W (2024). gdverse: Geographical detector models. R package version 0.0.3, https://github.com/SpatLyu/gdverse, https://spatlyu.github.io/gdverse/.","code":"@Manual{, title = {gdverse: Geographical detector models}, author = {Wenbo Lv}, year = {2024}, note = {R package version 0.0.3, https://github.com/SpatLyu/gdverse}, url = {https://spatlyu.github.io/gdverse/}, }"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"gdverse-","dir":"","previous_headings":"","what":"gdverse | Geodetector Models In R\n","title":"gdverse | Geodetector Models In R\n","text":"goal gdverse support geodetector model variants.","code":""},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"gdverse | Geodetector Models In R\n","text":"can install development version gdverse github : install gdverse r-universe:","code":"# install.packages(\"devtools\") devtools::install_github(\"SpatLyu/gdverse\",build_vignettes = T,dep = T) install.packages('gdverse', repos='https://spatlyu.r-universe.dev')"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"load-data-and-package","dir":"","previous_headings":"Installation","what":"Load data and package","title":"gdverse | Geodetector Models In R\n","text":"","code":"library(sf) library(terra) library(tidyverse) library(gdverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 ## # ℹ 1 more variable: aspect "},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"opgd-model","dir":"","previous_headings":"Installation","what":"OPGD model","title":"gdverse | Geodetector Models In R\n","text":"","code":"tictoc::tic() fvc_opgd = opgd(fvc ~ ., data = fvc, discnum = 3:15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = 'factor') tictoc::toc() ## 3.11 sec elapsed fvc_opgd ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"gozh-model","dir":"","previous_headings":"Installation","what":"GOZH model","title":"gdverse | Geodetector Models In R\n","text":"","code":"g = gozh(fvc ~ ., data = fvc, cores = 6) g ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"rgd-model","dir":"","previous_headings":"Installation","what":"RGD model","title":"gdverse | Geodetector Models In R\n","text":"run RGD,remember set python dependence, see RGD vignette get details.","code":"reticulate::use_condaenv('geocompy') tictoc::tic() fvc_rgd = rgd(fvc ~ ., data = fvc, discnum = 10, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = 'factor') tictoc::toc() ## 1886.14 sec elapsed fvc_rgd ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"ecological detector — ecological_detector","title":"ecological detector — ecological_detector","text":"Compare effects two factors \\(X_1\\) \\(X_2\\) spatial distribution attribute \\(Y\\).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ecological detector — ecological_detector","text":"","code":"ecological_detector(y, x1, x2, alpha = 0.95)"},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ecological detector — ecological_detector","text":"y Dependent variable, continuous numeric vector. x1 Covariate \\(X_1\\), factor, character discrete numeric. x2 Covariate \\(X_2\\), factor, character discrete numeric. alpha (optional) Confidence level interval,default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ecological detector — ecological_detector","text":"list contains F statistics, p-values, significant difference two factors \\(X_1\\) \\(X_2\\) spatial distribution attribute \\(Y\\)","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ecological detector — ecological_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"factor detector — factor_detector","title":"factor detector — factor_detector","text":"factor detector q-statistic measures spatial stratified heterogeneity variable Y, determinant power covariate X Y.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"factor detector — factor_detector","text":"","code":"factor_detector(y, x)"},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"factor detector — factor_detector","text":"y Variable Y, continuous numeric vector. x Covariate X, factor, character discrete numeric.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"factor detector — factor_detector","text":"list contains Q-statistic p-value.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"factor detector — factor_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":null,"dir":"Reference","previous_headings":"","what":"ordinary geographical detector model — gd","title":"ordinary geographical detector model — gd","text":"Function ordinary geographical detector model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ordinary geographical detector model — gd","text":"","code":"gd(formula, data, type = \"factor\", ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ordinary geographical detector model — gd","text":"formula formula geographical detector model. data data.frame tibble observation data. type (optional) type geographical detector,must one factor(default), interaction, risk, ecological. ... (optional) Specifies size alpha (confidence level).Default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ordinary geographical detector model — gd","text":"tibble corresponding result stored corresponding detector type.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"ordinary geographical detector model — gd","text":"Jin‐Feng Wang, Xin‐Hu Li, George Christakos, Yi‐Lan Liao, Tin Zhang, XueGu & Xiao‐Ying Zheng (2010) Geographical Detectors‐Based Health Risk Assessment Application Neural Tube Defects Study Heshun Region, China, International Journal Geographical Information Science, 24:1, 107-127, DOI: 10.1080/13658810802443457","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ordinary geographical detector model — gd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"ordinary geographical detector model — gd","text":"","code":"gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3)))) #> Spatial Stratified Heterogeneity Test #> #> Factor detector #> #> ---------------------------------- #> variable Q-statistic P-value #> ---------- ------------- --------- #> x2 0.8929 0.03168 #> #> x1 0.7714 0.07936 #> ---------------------------------- #> gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'interaction') #> Spatial Stratified Heterogeneity Test #> #> Interaction detector #> #> ------------------------------------------ #> Interactive variable Interaction #> ---------------------- ------------------- #> x1 ∩ x2 Weaken, nonlinear #> ------------------------------------------ #> gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'risk',alpha = 0.95) #> Spatial Stratified Heterogeneity Test #> #> Risk detector #> #> -------------------------------------- #> Variable x1: #> #> | |x |y |z | #> |:--|:--|:---|:---| #> |x |NA |No |No | #> |y |No |NA |Yes | #> |z |No |Yes |NA | #> -------------------------------------- #> Variable x2: #> #> | |a |b |c | #> |:--|:---|:---|:---| #> |a |NA |No |Yes | #> |b |No |NA |Yes | #> |c |Yes |Yes |NA | gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'ecological',alpha = 0.95) #> Spatial Stratified Heterogeneity Test #> #> ecological detector #> #> -------------------------------------- #> #> #> | |x2 | #> |:--|:--| #> |x1 |No |"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":null,"dir":"Reference","previous_headings":"","what":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"Function determining best univariate discretization based geodetector q-statistic.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"","code":"gd_bestunidisc( formula, data, discnum = NULL, discmethod = NULL, cores = 1, return_disc = TRUE, seed = 12345678, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"formula formula spatial stratified heterogeneity test. data data.frame tibble observation data. discnum (optional) vector number classes discretization. Default 3:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. return_disc (optional) Whether return discretized result used optimal parameter. Default TRUE. seed (optional) Random seed number, default 12345678.Setting random seed useful sample size greater 3000(default value largeN) data discretized sampling 10%(default value samp_prop). ... (optional) arguments passed st_unidisc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"list optimal parameter provided parameter combination k, method disc(return_disc TRUE).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 3:15,cores = 6) g }"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":null,"dir":"Reference","previous_headings":"","what":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"q-statistics geographical detector based recursive partitioning","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"","code":"gd_rpart(formula, data, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"formula formula. data data.frame tibble observation data. ... (optional) arguments passed rpart::rpart().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"tibble contains Q-statistic p-value.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":null,"dir":"Reference","previous_headings":"","what":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Function comparison size effects spatial units spatial heterogeneity analysis based optimal parameters geographical detector(OPGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"","code":"gd_sesu( formula, datalist, su, discvar, discnum = NULL, discmethod = NULL, cores = 1, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"formula formula. datalist list data.frame tibble. su vector sizes spatial units. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum (optional) vector number classes discretization. Default 2:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. ... (optional) arguments passed gd_bestunidisc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"nested tibble spatial_units, sesu_result data.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Song, Y., Wang, J., Ge, Y. & Xu, C. (2020) optimal parameters-based geographical detector model enhances geographic characteristics explanatory variables spatial heterogeneity analysis: Cases different types spatial data, GIScience & Remote Sensing, 57(5), 593-610. doi: 10.1080/15481603.2020.1760434.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"","code":"if (FALSE) { library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc1000 = fvc %>% terra::as.data.frame(na.rm = T) %>% as_tibble() fvc5000 = fvc %>% terra::aggregate(fact = 5) %>% terra::as.data.frame(na.rm = T) %>% as_tibble() gd_sesu(fvc ~ ., datalist = list(fvc1000,fvc5000), su = c(1000,5000), discnum = 2:15, discvar = names(select(fvc5000,-c(fvc,lulc))), cores = 6) }"},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":null,"dir":"Reference","previous_headings":"","what":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Function geographically optimal zones-based heterogeneity(GOZH) model","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"","code":"gozh(formula, data, cores = 1, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"formula formula GOZH model. data data.frame tibble observation data. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. ... (optional) arguments passed rpart::rpart().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"list GOZH model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Luo, P., Song, Y., Huang, X., Ma, H., Liu, J., Yao, Y., & Meng, L. (2022). Identifying determinants spatio-temporal disparities soil moisture Northern Hemisphere using geographically optimal zones-based heterogeneity model. ISPRS Journal Photogrammetry Remote Sensing: Official Publication International Society Photogrammetry Remote Sensing (ISPRS), 185, 111–128. https://doi.org/10.1016/j.isprsjprs.2022.01.009","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"","code":"if (FALSE) { ndvi = GD::ndvi_40 g = gozh(NDVIchange ~ ., data = ndvi) g }"},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"interaction detector — interaction_detector","title":"interaction detector — interaction_detector","text":"Identify interaction different risk factors, , assess whether factors X1 X2 together increase decrease explanatory power dependent variable Y, whether effects factors Y independent .","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"interaction detector — interaction_detector","text":"","code":"interaction_detector(y, x1, x2)"},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"interaction detector — interaction_detector","text":"y Dependent variable, continuous numeric vector. x1 Covariate \\(X_1\\), factor, character discrete numeric. x2 Covariate \\(X_2\\), factor, character discrete numeric.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"interaction detector — interaction_detector","text":"list contains Q statistic factors \\(X_1\\) \\(X_1\\) act \\(Y\\) alone Q statistic two interact \\(Y\\) together result type interaction detector.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"interaction detector — interaction_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":null,"dir":"Reference","previous_headings":"","what":"optimal parameters geographical detector(OPGD) model — opgd","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Function optimal parameters geographical detector(OPGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"","code":"opgd( formula, data, discvar, discnum = NULL, discmethod = NULL, cores = 1, type = \"factor\", alpha = 0.95, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"formula formula OPGD model. data data.frame tibble observation data. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum (optional) vector number classes discretization. Default 3:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. type (optional) type geographical detector,must factor(default), interaction, risk, ecological.can run one time. alpha (optional) Specifies size confidence level.Default 0.95. ... (optional) arguments passed gd_bestunidisc().useful parameter seed, used set random number seed.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"list OPGD model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Song, Y., Wang, J., Ge, Y. & Xu, C. (2020) optimal parameters-based geographical detector model enhances geographic characteristics explanatory variables spatial heterogeneity analysis: Cases different types spatial data, GIScience & Remote Sensing, 57(5), 593-610. doi: 10.1080/15481603.2020.1760434.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) opgd(fvc ~ ., data = fvc, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type =c('factor','interaction')) }"},{"path":"https://spatlyu.github.io/gdverse/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print ecological detector — print.ecological_detector","title":"print ecological detector — print.ecological_detector","text":"S3 method format output ecological detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print ecological detector — print.ecological_detector","text":"","code":"# S3 method for ecological_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print ecological detector — print.ecological_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print ecological detector — print.ecological_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print ecological detector — print.ecological_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print factor detector — print.factor_detector","title":"print factor detector — print.factor_detector","text":"S3 method format output factor detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print factor detector — print.factor_detector","text":"","code":"# S3 method for factor_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print factor detector — print.factor_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print factor detector — print.factor_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print factor detector — print.factor_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print interaction detector — print.interaction_detector","title":"print interaction detector — print.interaction_detector","text":"S3 method format output interaction detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print interaction detector — print.interaction_detector","text":"","code":"# S3 method for interaction_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print interaction detector — print.interaction_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print interaction detector — print.interaction_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print interaction detector — print.interaction_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print risk detector — print.risk_detector","title":"print risk detector — print.risk_detector","text":"S3 method format output risk detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print risk detector — print.risk_detector","text":"","code":"# S3 method for risk_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print risk detector — print.risk_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print risk detector — print.risk_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print risk detector — print.risk_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":null,"dir":"Reference","previous_headings":"","what":"robust geographical detector(RGD) model — rgd","title":"robust geographical detector(RGD) model — rgd","text":"Function robust geographical detector(RGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"robust geographical detector(RGD) model — rgd","text":"","code":"rgd( formula, data, discvar, discnum = NULL, minsize = NULL, cores = 1, type = \"factor\", alpha = 0.95, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"robust geographical detector(RGD) model — rgd","text":"formula formula RGD model. data data.frame tibble observation data. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum numeric vector discretized classes columns need discretized. Default discvar use 10. minsize (optional) min size discretization group.Default use 1. cores (optional) Positive integer(default 1). cores > 1, use python's joblib package parallel computation. type (optional) type geographical detector,must factor(default), interaction, risk, ecological.can run one time. alpha (optional) Specifies size confidence level.Default 0.95. ... (optional) arguments passed robust_disc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"robust geographical detector(RGD) model — rgd","text":"list RGD model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"robust geographical detector(RGD) model — rgd","text":"Zhang, Z., Song, Y.*, & Wu, P., 2022. Robust geographical detector. International Journal Applied Earth Observation Geoinformation. 109, 102782. DOI: 10.1016/j.jag.2022.102782.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"robust geographical detector(RGD) model — rgd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"robust geographical detector(RGD) model — rgd","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) rgd(fvc ~ ., data = fvc, discnum = 10, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type =c('factor','interaction')) }"},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"risk detector — risk_detector","title":"risk detector — risk_detector","text":"Determine whether significant difference attribute means two subregions.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"risk detector — risk_detector","text":"","code":"risk_detector(y, x, alpha = 0.95)"},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"risk detector — risk_detector","text":"y Variable Y, continuous numeric vector. x Covariate X, factor, character discrete numeric. alpha (optional) Confidence level interval,default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"risk detector — risk_detector","text":"tibble contains different combinations covariate X level student t-test statistics, degrees freedom, p-values, whether risk (Yes ).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"risk detector — risk_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":null,"dir":"Reference","previous_headings":"","what":"univariate discretization based on offline change point detection. — robust_disc","title":"univariate discretization based on offline change point detection. — robust_disc","text":"Determines discretization interval breaks using optimization algorithm variance-based change point detection.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"univariate discretization based on offline change point detection. — robust_disc","text":"","code":"robust_disc(formula, data, discnum, minsize = NULL, cores = 1)"},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"univariate discretization based on offline change point detection. — robust_disc","text":"formula formula spatial stratified heterogeneity test. data data.frame tibble observation data. discnum numeric vector discretized classes columns need discretized. minsize (optional) min size discretization group.Default use 1. cores (optional) Positive integer(default 1). cores > 1, use python's joblib package parallel computation.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"univariate discretization based on offline change point detection. — robust_disc","text":"tibble discretized classes columns need discretized.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"univariate discretization based on offline change point detection. — robust_disc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"univariate discretization based on offline change point detection. — robust_disc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) new.fvc = robust_disc(fvc ~ .,data = select(fvc,-lulc),discnum = 10,cores = 6) new.fvc }"},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":null,"dir":"Reference","previous_headings":"","what":"univariate discretization — st_unidisc","title":"univariate discretization — st_unidisc","text":"Function classify univariate vector interval,wrapper classInt::classify_intervals().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"univariate discretization — st_unidisc","text":"","code":"st_unidisc(x, k, method = \"quantile\", factor = FALSE, seed = 12345678, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"univariate discretization — st_unidisc","text":"x continuous numerical variable. k (optional) Number classes required, missing, grDevices::nclass.Sturges() used; see also \"dpih\" \"headtails\" styles automatic choice number classes. k must greater 3 ! method Chosen classify style: one \"fixed\", \"sd\", \"equal\", \"pretty\", \"quantile\", \"kmeans\", \"hclust\", \"bclust\", \"fisher\", \"jenks\", \"dpih\", \"headtails\", \"maximum\", \"box\".Default quantile. factor (optional) Default FALSE, TRUE returns cols factor intervals labels rather integers. seed (optional) Random seed number, default 12345678.Setting random seed useful sample size greater 3000(default value largeN) data discretized sampling 10%(default value samp_prop). ... (optional) arguments passed classInt::classify_intervals(), see ?classInt::classify_intervals().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"univariate discretization — st_unidisc","text":"discrete vectors classified.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"univariate discretization — st_unidisc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"univariate discretization — st_unidisc","text":"","code":"xvar = c(22361, 9573, 4836, 5309, 10384, 4359, 11016, 4414, 3327, 3408, 17816, 6909, 6936, 7990, 3758, 3569, 21965, 3605, 2181, 1892, 2459, 2934, 6399, 8578, 8537, 4840, 12132, 3734, 4372, 9073, 7508, 5203) st_unidisc(xvar,k = 6,method = 'sd') #> [1] 5 3 2 2 3 2 3 2 2 2 5 2 2 3 2 2 5 2 2 1 2 2 2 3 3 2 3 2 2 3 3 2"},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"gdverse-development-version","dir":"Changelog","previous_headings":"","what":"gdverse (development version)","title":"gdverse (development version)","text":"Support geodetector model variants fix bugs gdverse.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-3","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.3","text":"Support GOZH model.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-2","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.2","text":"Solve computational stability problem OPGD model.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-1","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.1","text":"Can now work well OPGD RGD model.","code":""}] +[{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"load-data-and-package","dir":"Articles","previous_headings":"","what":"Load data and package","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"library(terra) library(tidyverse) library(gdverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = aggregate(fvc,fact = 5) fvc ## class : SpatRaster ## dimensions : 84, 114, 13 (nrow, ncol, nlyr) ## resolution : 5000, 5000 (x, y) ## extent : -92742.16, 477257.8, 3589385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source(s) : memory ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1527159, 111.2089, 2.340401, 3834.887, 10.92638, -9.976424, ... ## max values : 0.8905939, 247.1408, 75.933422, 8276.911, 26.72104, 1.101411, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" \"ntl\" \"lulc\" ## [11] \"elev\" \"slope\" \"aspect\""},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"convert-data-from-spatraster-to-tibble","dir":"Articles","previous_headings":"","what":"Convert data from SpatRaster to tibble","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope aspect ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 122. ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 174. ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 192. ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 213. ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 132. ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 137."},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"determine-optimal-discretization-parameters","dir":"Articles","previous_headings":"","what":"Determine optimal discretization parameters","title":"Optimal Parameters Geographical Detector(OPGD)","text":"lulc discrete category variable fvc data, need discretize others. can use gd_bestunidisc() discretize based geodetector q-statistic. new.fvc discrete result optimal discretization parameter based Q statistic geographic detector,can combine fvc lulc col fvc tibble now.","code":"tictoc::tic() g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 3:15,cores = 6) tictoc::toc() ## 3.79 sec elapsed g ## $x ## [1] \"aspect\" \"elev\" \"ntl\" \"pop\" \"premax\" \"premin\" \"presum\" \"slope\" \"tmpavg\" \"tmpmax\" ## [11] \"tmpmin\" ## ## $k ## [1] 12 14 12 14 12 14 15 11 15 15 13 ## ## $method ## [1] \"pretty\" \"quantile\" \"fisher\" \"quantile\" \"fisher\" \"fisher\" \"fisher\" \"equal\" ## [9] \"fisher\" \"quantile\" \"fisher\" ## ## $disv ## # A tibble: 5,240 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 3 10 3 2 5 1 1 2 6 9 2 ## 2 4 9 4 4 5 1 1 2 7 11 2 ## 3 4 10 3 2 5 1 1 2 6 9 2 ## 4 5 11 2 2 6 1 1 3 5 7 2 ## 5 3 10 4 1 5 1 1 2 6 9 2 ## 6 3 9 4 1 5 1 1 2 7 11 2 ## 7 3 9 3 3 5 1 1 1 7 11 2 ## 8 5 9 4 2 5 1 1 2 7 11 2 ## 9 4 10 5 7 5 1 1 2 6 9 2 ## 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows new.fvc = g$disv new.fvc ## # A tibble: 5,240 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 3 10 3 2 5 1 1 2 6 9 2 ## 2 4 9 4 4 5 1 1 2 7 11 2 ## 3 4 10 3 2 5 1 1 2 6 9 2 ## 4 5 11 2 2 6 1 1 3 5 7 2 ## 5 3 10 4 1 5 1 1 2 6 9 2 ## 6 3 9 4 1 5 1 1 2 7 11 2 ## 7 3 9 3 3 5 1 1 1 7 11 2 ## 8 5 9 4 2 5 1 1 2 7 11 2 ## 9 4 10 5 7 5 1 1 2 6 9 2 ## 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 5,240 × 13 ## fvc lulc aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 0.188 10 3 10 3 2 5 1 1 2 6 9 2 ## 2 0.162 10 4 9 4 4 5 1 1 2 7 11 2 ## 3 0.168 10 4 10 3 2 5 1 1 2 6 9 2 ## 4 0.186 10 5 11 2 2 6 1 1 3 5 7 2 ## 5 0.189 10 3 10 4 1 5 1 1 2 6 9 2 ## 6 0.171 10 3 9 4 1 5 1 1 2 7 11 2 ## 7 0.153 10 3 9 3 3 5 1 1 1 7 11 2 ## 8 0.163 10 5 9 4 2 5 1 1 2 7 11 2 ## 9 0.176 10 4 10 5 7 5 1 1 2 6 9 2 ## 10 0.177 10 5 9 3 3 5 1 1 2 7 10 2 ## # ℹ 5,230 more rows"},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"Optimal Parameters Geographical Detector(OPGD)","text":", can run geodetector model gd() function.","code":"gd(fvc ~ .,data = new.fvc,type = 'factor') ## Spatial Stratified Heterogeneity Test ## ## Factor detector gd(fvc ~ .,data = new.fvc,type = 'interaction') ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"you-can-also-use-opgd-in-one-time-to-get-result-above-","dir":"Articles","previous_headings":"","what":"You can also use opgd() in one time to get result above.","title":"Optimal Parameters Geographical Detector(OPGD)","text":"","code":"fvc_opgd = opgd(fvc ~ ., data = fvc, discnum = 3:15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = c('factor','interaction')) str(fvc_opgd) ## List of 2 ## $ :List of 1 ## ..$ factor: tibble [12 × 3] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable : chr [1:12] \"presum\" \"lulc\" \"premin\" \"tmpmin\" ... ## .. ..$ Q-statistic: num [1:12] 0.663 0.66 0.465 0.428 0.254 ... ## .. ..$ P-value : num [1:12] 9.15e-10 8.78e-10 4.83e-10 5.54e-10 7.85e-10 ... ## ..- attr(*, \"class\")= chr \"factor_detector\" ## $ :List of 1 ## ..$ interaction: tibble [66 × 6] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable1 : chr [1:66] \"lulc\" \"lulc\" \"lulc\" \"lulc\" ... ## .. ..$ variable2 : chr [1:66] \"aspect\" \"elev\" \"ntl\" \"pop\" ... ## .. ..$ Interaction : chr [1:66] \"Enhance, nonlinear\" \"Enhance, bi-\" \"Enhance, nonlinear\" \"Enhance, bi-\" ... ## .. ..$ Variable1 Q-statistics : num [1:66] 0.66 0.66 0.66 0.66 0.66 ... ## .. ..$ Variable2 Q-statistics : num [1:66] 0.0118 0.2318 0.0225 0.1896 0.1417 ... ## .. ..$ Variable1 and Variable2 interact Q-statistics: num [1:66] 0.683 0.82 0.724 0.754 0.769 ... ## ..- attr(*, \"class\")= chr \"interaction_detector\" fvc_opgd[[1]] ## Spatial Stratified Heterogeneity Test ## ## Factor detector fvc_opgd[[2]] ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"set-up-your-python-dependence","dir":"Articles","previous_headings":"","what":"Set up your python dependence","title":"Robust Geographical Detector(RGD)","text":"install miniconda create new conda env geocompy use conda create -n geocompy python=3.9 -y activate env conda activate geocompy install mamba conda install -c conda-forge mamba -y. set python packages use mamba install -c conda-forge numpy==1.23.5 joblib pandas ruptures -y","code":""},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"load-data-and-package","dir":"Articles","previous_headings":"","what":"Load data and package","title":"Robust Geographical Detector(RGD)","text":"","code":"library(terra) ## terra 1.7.78 library(tidyverse) ## ── Attaching core tidyverse packages ─────────────────────────────────────── tidyverse 2.0.0 ── ## ✔ dplyr 1.1.4 ✔ readr 2.1.5 ## ✔ forcats 1.0.0 ✔ stringr 1.5.1 ## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1 ## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1 ## ✔ purrr 1.0.2 ## ── Conflicts ───────────────────────────────────────────────────────── tidyverse_conflicts() ── ## ✖ tidyr::extract() masks terra::extract() ## ✖ dplyr::filter() masks gdverse::filter(), stats::filter() ## ✖ dplyr::lag() masks stats::lag() ## ℹ Use the conflicted package () to force all conflicts to become errors library(gdverse) reticulate::use_condaenv('geocompy') fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = aggregate(fvc,fact = 5) fvc ## class : SpatRaster ## dimensions : 84, 114, 13 (nrow, ncol, nlyr) ## resolution : 5000, 5000 (x, y) ## extent : -92742.16, 477257.8, 3589385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source(s) : memory ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1527159, 111.2089, 2.340401, 3834.887, 10.92638, -9.976424, ... ## max values : 0.8905939, 247.1408, 75.933422, 8276.911, 26.72104, 1.101411, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" \"ntl\" \"lulc\" ## [11] \"elev\" \"slope\" \"aspect\""},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"convert-data-from-spatraster-to-tibble","dir":"Articles","previous_headings":"","what":"Convert data from SpatRaster to tibble","title":"Robust Geographical Detector(RGD)","text":"","code":"fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope aspect ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 122. ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 174. ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 192. ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 213. ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 132. ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 137."},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"determine-discretization-use-offline-change-point-detection","dir":"Articles","previous_headings":"","what":"Determine discretization use offline change point detection","title":"Robust Geographical Detector(RGD)","text":"lulc discrete category variable fvc data, need discretize others. can use robust_disc() discretize based offline change point detection. new.fvc discrete result,can combine fvc lulc col fvc tibble now.","code":"tictoc::tic() new.fvc = robust_disc(fvc ~ .,data = select(fvc,-lulc),discnum = 15,cores = 6) tictoc::toc() ## 2595.78 sec elapsed new.fvc ## # A tibble: 5,240 × 11 ## premax premin presum tmpmax tmpmin tmpavg pop ntl elev slope aspect ## ## 1 group10 group1 group1 group8 group4 group5 group7 group14 group13 group10 group4 ## 2 group10 group1 group1 group9 group4 group7 group10 group14 group11 group10 group14 ## 3 group11 group1 group1 group8 group4 group5 group8 group14 group13 group10 group14 ## 4 group13 group1 group1 group8 group2 group4 group7 group14 group13 group11 group14 ## 5 group10 group1 group1 group8 group4 group5 group1 group14 group13 group10 group7 ## 6 group10 group1 group1 group9 group4 group5 group2 group14 group11 group10 group7 ## 7 group10 group1 group1 group9 group4 group7 group8 group14 group9 group6 group4 ## 8 group10 group1 group1 group9 group4 group7 group8 group14 group9 group10 group14 ## 9 group10 group1 group1 group8 group4 group5 group10 group14 group13 group10 group14 ## 10 group11 group1 group1 group8 group4 group5 group9 group14 group9 group10 group14 ## # ℹ 5,230 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 5,240 × 13 ## fvc lulc premax premin presum tmpmax tmpmin tmpavg pop ntl elev slope aspect ## ## 1 0.188 10 group10 group1 group1 group8 group4 group5 group7 group14 group13 group… group4 ## 2 0.162 10 group10 group1 group1 group9 group4 group7 group10 group14 group11 group… group… ## 3 0.168 10 group11 group1 group1 group8 group4 group5 group8 group14 group13 group… group… ## 4 0.186 10 group13 group1 group1 group8 group2 group4 group7 group14 group13 group… group… ## 5 0.189 10 group10 group1 group1 group8 group4 group5 group1 group14 group13 group… group7 ## 6 0.171 10 group10 group1 group1 group9 group4 group5 group2 group14 group11 group… group7 ## 7 0.153 10 group10 group1 group1 group9 group4 group7 group8 group14 group9 group6 group4 ## 8 0.163 10 group10 group1 group1 group9 group4 group7 group8 group14 group9 group… group… ## 9 0.176 10 group10 group1 group1 group8 group4 group5 group10 group14 group13 group… group… ## 10 0.177 10 group11 group1 group1 group8 group4 group5 group9 group14 group9 group… group… ## # ℹ 5,230 more rows"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"Robust Geographical Detector(RGD)","text":",can run geodetector model gd() function.","code":"gd(fvc ~ .,data = new.fvc,type = 'factor') ## Spatial Stratified Heterogeneity Test ## ## Factor detector gd(fvc ~ .,data = new.fvc,type = 'interaction') ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/articles/RGD.html","id":"you-can-also-use-rgd-in-one-time-to-get-result-above-","dir":"Articles","previous_headings":"","what":"You can also use rgd() in one time to get result above.","title":"Robust Geographical Detector(RGD)","text":"","code":"fvc_rgd = rgd(fvc ~ ., data = fvc, discnum = 15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = c('factor','interaction')) str(fvc_rgd) ## List of 2 ## $ :List of 1 ## ..$ factor: tibble [12 × 3] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable : chr [1:12] \"presum\" \"lulc\" \"premin\" \"tmpmin\" ... ## .. ..$ Q-statistic: num [1:12] 0.674 0.66 0.486 0.458 0.282 ... ## .. ..$ P-value : num [1:12] 6.17e-10 8.78e-10 5.46e-10 6.23e-10 5.85e-10 ... ## ..- attr(*, \"class\")= chr \"factor_detector\" ## $ :List of 1 ## ..$ interaction: tibble [66 × 6] (S3: tbl_df/tbl/data.frame) ## .. ..$ variable1 : chr [1:66] \"lulc\" \"lulc\" \"lulc\" \"lulc\" ... ## .. ..$ variable2 : chr [1:66] \"premax\" \"premin\" \"presum\" \"tmpmax\" ... ## .. ..$ Interaction : chr [1:66] \"Enhance, bi-\" \"Enhance, bi-\" \"Enhance, bi-\" \"Enhance, bi-\" ... ## .. ..$ Variable1 Q-statistics : num [1:66] 0.66 0.66 0.66 0.66 0.66 ... ## .. ..$ Variable2 Q-statistics : num [1:66] 0.167 0.486 0.674 0.282 0.458 ... ## .. ..$ Variable1 and Variable2 interact Q-statistics: num [1:66] 0.771 0.791 0.817 0.82 0.848 ... ## ..- attr(*, \"class\")= chr \"interaction_detector\" fvc_rgd[[1]] ## Spatial Stratified Heterogeneity Test ## ## Factor detector fvc_rgd[[2]] ## Spatial Stratified Heterogeneity Test ## ## Interaction detector"},{"path":"https://spatlyu.github.io/gdverse/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Wenbo Lv. Author, maintainer.","code":""},{"path":"https://spatlyu.github.io/gdverse/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lv W (2024). gdverse: Geographical detector models. R package version 0.0.3, https://github.com/SpatLyu/gdverse, https://spatlyu.github.io/gdverse/.","code":"@Manual{, title = {gdverse: Geographical detector models}, author = {Wenbo Lv}, year = {2024}, note = {R package version 0.0.3, https://github.com/SpatLyu/gdverse}, url = {https://spatlyu.github.io/gdverse/}, }"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"gdverse-","dir":"","previous_headings":"","what":"gdverse | Geodetector Models In R\n","title":"gdverse | Geodetector Models In R\n","text":"goal gdverse support geodetector model variants.","code":""},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"gdverse | Geodetector Models In R\n","text":"can install development version gdverse github : install gdverse r-universe:","code":"# install.packages(\"devtools\") devtools::install_github(\"SpatLyu/gdverse\",build_vignettes = T,dep = T) install.packages('gdverse', repos='https://spatlyu.r-universe.dev')"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"load-data-and-package","dir":"","previous_headings":"Installation","what":"Load data and package","title":"gdverse | Geodetector Models In R\n","text":"","code":"library(sf) library(terra) library(tidyverse) library(gdverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) head(fvc) ## # A tibble: 6 × 13 ## fvc premax premin presum tmpmax tmpmin tmpavg pop ntl lulc elev slope ## ## 1 0.188 163. 6.86 3992. 21.2 -7.09 8.54 5.64 9.10 10 1645. 2.96 ## 2 0.162 162. 5.23 3922. 21.7 -6.90 8.92 23.1 10.5 10 1539. 1.86 ## 3 0.168 168. 4.15 4040. 21.2 -7.22 8.53 9.73 5.58 10 1611. 3.19 ## 4 0.186 174. 5.99 4254. 20.8 -7.42 8.21 6.84 2.89 10 1677. 3.32 ## 5 0.189 164. 7.86 4047. 21.2 -7.00 8.58 2.36 12.3 10 1643. 2.79 ## 6 0.171 161. 5.23 3944. 21.7 -6.85 8.91 3.17 10.1 10 1553. 1.93 ## # ℹ 1 more variable: aspect "},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"opgd-model","dir":"","previous_headings":"Installation","what":"OPGD model","title":"gdverse | Geodetector Models In R\n","text":"","code":"tictoc::tic() fvc_opgd = opgd(fvc ~ ., data = fvc, discnum = 3:15, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = 'factor') tictoc::toc() ## 3.11 sec elapsed fvc_opgd ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"gozh-model","dir":"","previous_headings":"Installation","what":"GOZH model","title":"gdverse | Geodetector Models In R\n","text":"","code":"g = gozh(fvc ~ ., data = fvc, cores = 6) g ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"rgd-model","dir":"","previous_headings":"Installation","what":"RGD model","title":"gdverse | Geodetector Models In R\n","text":"run RGD,remember set python dependence, see RGD vignette get details.","code":"reticulate::use_condaenv('geocompy') tictoc::tic() fvc_rgd = rgd(fvc ~ ., data = fvc, discnum = 10, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = 'factor') tictoc::toc() ## 1886.14 sec elapsed fvc_rgd ## Spatial Stratified Heterogeneity Test ## ## Factor detector"},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"ecological detector — ecological_detector","title":"ecological detector — ecological_detector","text":"Compare effects two factors \\(X_1\\) \\(X_2\\) spatial distribution attribute \\(Y\\).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"ecological detector — ecological_detector","text":"","code":"ecological_detector(y, x1, x2, alpha = 0.95)"},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"ecological detector — ecological_detector","text":"y Dependent variable, continuous numeric vector. x1 Covariate \\(X_1\\), factor, character discrete numeric. x2 Covariate \\(X_2\\), factor, character discrete numeric. alpha (optional) Confidence level interval,default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"ecological detector — ecological_detector","text":"list contains F statistics, p-values, significant difference two factors \\(X_1\\) \\(X_2\\) spatial distribution attribute \\(Y\\)","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/ecological_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"ecological detector — ecological_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"factor detector — factor_detector","title":"factor detector — factor_detector","text":"factor detector q-statistic measures spatial stratified heterogeneity variable Y, determinant power covariate X Y.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"factor detector — factor_detector","text":"","code":"factor_detector(y, x)"},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"factor detector — factor_detector","text":"y Variable Y, continuous numeric vector. x Covariate X, factor, character discrete numeric.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"factor detector — factor_detector","text":"list contains Q-statistic p-value.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/factor_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"factor detector — factor_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":null,"dir":"Reference","previous_headings":"","what":"original geographical detector model — gd","title":"original geographical detector model — gd","text":"Function original geographical detector model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"original geographical detector model — gd","text":"","code":"gd(formula, data, type = \"factor\", ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"original geographical detector model — gd","text":"formula formula geographical detector model. data data.frame tibble observation data. type (optional) type geographical detector,must one factor(default), interaction, risk, ecological. ... (optional) Specifies size alpha (confidence level).Default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"original geographical detector model — gd","text":"tibble corresponding result stored corresponding detector type.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"original geographical detector model — gd","text":"Jin‐Feng Wang, Xin‐Hu Li, George Christakos, Yi‐Lan Liao, Tin Zhang, XueGu & Xiao‐Ying Zheng (2010) Geographical Detectors‐Based Health Risk Assessment Application Neural Tube Defects Study Heshun Region, China, International Journal Geographical Information Science, 24:1, 107-127, DOI: 10.1080/13658810802443457","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"original geographical detector model — gd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"original geographical detector model — gd","text":"","code":"gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3)))) #> Spatial Stratified Heterogeneity Test #> #> Factor detector #> #> ---------------------------------- #> variable Q-statistic P-value #> ---------- ------------- --------- #> x2 0.8929 0.03168 #> #> x1 0.7714 0.07936 #> ---------------------------------- #> gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'interaction') #> Spatial Stratified Heterogeneity Test #> #> Interaction detector #> #> ------------------------------------------ #> Interactive variable Interaction #> ---------------------- ------------------- #> x1 ∩ x2 Weaken, nonlinear #> ------------------------------------------ #> gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'risk',alpha = 0.95) #> Spatial Stratified Heterogeneity Test #> #> Risk detector #> #> -------------------------------------- #> Variable x1: #> #> | |x |y |z | #> |:--|:--|:---|:---| #> |x |NA |No |No | #> |y |No |NA |Yes | #> |z |No |Yes |NA | #> -------------------------------------- #> Variable x2: #> #> | |a |b |c | #> |:--|:---|:---|:---| #> |a |NA |No |Yes | #> |b |No |NA |Yes | #> |c |Yes |Yes |NA | gd(y ~ x1 + x2, tibble::tibble(y = 1:7, x1 = c('x',rep('y',3),rep('z',3)), x2 = c(rep('a',2),rep('b',2),rep('c',3))), type = 'ecological',alpha = 0.95) #> Spatial Stratified Heterogeneity Test #> #> ecological detector #> #> -------------------------------------- #> #> #> | |x2 | #> |:--|:--| #> |x1 |No |"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":null,"dir":"Reference","previous_headings":"","what":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"Function determining best univariate discretization based geodetector q-statistic.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"","code":"gd_bestunidisc( formula, data, discnum = NULL, discmethod = NULL, cores = 1, return_disc = TRUE, seed = 12345678, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"formula formula spatial stratified heterogeneity test. data data.frame tibble observation data. discnum (optional) vector number classes discretization. Default 3:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. return_disc (optional) Whether return discretized result used optimal parameter. Default TRUE. seed (optional) Random seed number, default 12345678.Setting random seed useful sample size greater 3000(default value largeN) data discretized sampling 10%(default value samp_prop). ... (optional) arguments passed st_unidisc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"list optimal parameter provided parameter combination k, method disc(return_disc TRUE).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"best univariate discretization based on geodetector q-statistic — gd_bestunidisc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 3:15,cores = 6) g }"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":null,"dir":"Reference","previous_headings":"","what":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"q-statistics geographical detector based recursive partitioning","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"","code":"gd_rpart(formula, data, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"formula formula. data data.frame tibble observation data. ... (optional) arguments passed rpart::rpart().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"tibble contains Q-statistic p-value.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_rpart.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"q-statistics of geographical detector based on recursive partitioning — gd_rpart","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":null,"dir":"Reference","previous_headings":"","what":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Function comparison size effects spatial units spatial heterogeneity analysis based optimal parameters geographical detector(OPGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"","code":"gd_sesu( formula, datalist, su, discvar, discnum = NULL, discmethod = NULL, cores = 1, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"formula formula. datalist list data.frame tibble. su vector sizes spatial units. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum (optional) vector number classes discretization. Default 2:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. ... (optional) arguments passed gd_bestunidisc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"nested tibble spatial_units, sesu_result data.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Song, Y., Wang, J., Ge, Y. & Xu, C. (2020) optimal parameters-based geographical detector model enhances geographic characteristics explanatory variables spatial heterogeneity analysis: Cases different types spatial data, GIScience & Remote Sensing, 57(5), 593-610. doi: 10.1080/15481603.2020.1760434.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd_sesu.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"comparison of size effects of spatial units based on optimal parameters geographical detector(OPGD) model. — gd_sesu","text":"","code":"if (FALSE) { library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc1000 = fvc %>% terra::as.data.frame(na.rm = T) %>% as_tibble() fvc5000 = fvc %>% terra::aggregate(fact = 5) %>% terra::as.data.frame(na.rm = T) %>% as_tibble() gd_sesu(fvc ~ ., datalist = list(fvc1000,fvc5000), su = c(1000,5000), discnum = 2:15, discvar = names(select(fvc5000,-c(fvc,lulc))), cores = 6) }"},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":null,"dir":"Reference","previous_headings":"","what":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Function geographically optimal zones-based heterogeneity(GOZH) model","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"","code":"gozh(formula, data, cores = 1, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"formula formula GOZH model. data data.frame tibble observation data. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. ... (optional) arguments passed rpart::rpart().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"list GOZH model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Luo, P., Song, Y., Huang, X., Ma, H., Liu, J., Yao, Y., & Meng, L. (2022). Identifying determinants spatio-temporal disparities soil moisture Northern Hemisphere using geographically optimal zones-based heterogeneity model. ISPRS Journal Photogrammetry Remote Sensing: Official Publication International Society Photogrammetry Remote Sensing (ISPRS), 185, 111–128. https://doi.org/10.1016/j.isprsjprs.2022.01.009","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gozh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"geographically optimal zones-based heterogeneity(GOZH) model — gozh","text":"","code":"if (FALSE) { ndvi = GD::ndvi_40 g = gozh(NDVIchange ~ ., data = ndvi) g }"},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"interaction detector — interaction_detector","title":"interaction detector — interaction_detector","text":"Identify interaction different risk factors, , assess whether factors X1 X2 together increase decrease explanatory power dependent variable Y, whether effects factors Y independent .","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"interaction detector — interaction_detector","text":"","code":"interaction_detector(y, x1, x2)"},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"interaction detector — interaction_detector","text":"y Dependent variable, continuous numeric vector. x1 Covariate \\(X_1\\), factor, character discrete numeric. x2 Covariate \\(X_2\\), factor, character discrete numeric.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"interaction detector — interaction_detector","text":"list contains Q statistic factors \\(X_1\\) \\(X_1\\) act \\(Y\\) alone Q statistic two interact \\(Y\\) together result type interaction detector.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/interaction_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"interaction detector — interaction_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":null,"dir":"Reference","previous_headings":"","what":"optimal parameters geographical detector(OPGD) model — opgd","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Function optimal parameters geographical detector(OPGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"","code":"opgd( formula, data, discvar, discnum = NULL, discmethod = NULL, cores = 1, type = \"factor\", alpha = 0.95, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"formula formula OPGD model. data data.frame tibble observation data. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum (optional) vector number classes discretization. Default 3:15. discmethod (optional) vector methods discretization,default used c(\"sd\",\"equal\",\"pretty\",\"quantile\",\"fisher\",\"headtails\",\"maximum\",\"box\")spEcula. cores positive integer(default 1). cores > 1, 'parallel' package cluster many cores created used. can also supply cluster object. type (optional) type geographical detector,must factor(default), interaction, risk, ecological.can run one time. alpha (optional) Specifies size confidence level.Default 0.95. ... (optional) arguments passed gd_bestunidisc().useful parameter seed, used set random number seed.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"list OPGD model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Song, Y., Wang, J., Ge, Y. & Xu, C. (2020) optimal parameters-based geographical detector model enhances geographic characteristics explanatory variables spatial heterogeneity analysis: Cases different types spatial data, GIScience & Remote Sensing, 57(5), 593-610. doi: 10.1080/15481603.2020.1760434.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"optimal parameters geographical detector(OPGD) model — opgd","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) opgd(fvc ~ ., data = fvc, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type =c('factor','interaction')) }"},{"path":"https://spatlyu.github.io/gdverse/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print ecological detector — print.ecological_detector","title":"print ecological detector — print.ecological_detector","text":"S3 method format output ecological detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print ecological detector — print.ecological_detector","text":"","code":"# S3 method for ecological_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print ecological detector — print.ecological_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print ecological detector — print.ecological_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print ecological detector — print.ecological_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print factor detector — print.factor_detector","title":"print factor detector — print.factor_detector","text":"S3 method format output factor detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print factor detector — print.factor_detector","text":"","code":"# S3 method for factor_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print factor detector — print.factor_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print factor detector — print.factor_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.factor_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print factor detector — print.factor_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print interaction detector — print.interaction_detector","title":"print interaction detector — print.interaction_detector","text":"S3 method format output interaction detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print interaction detector — print.interaction_detector","text":"","code":"# S3 method for interaction_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print interaction detector — print.interaction_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print interaction detector — print.interaction_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.interaction_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print interaction detector — print.interaction_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"print risk detector — print.risk_detector","title":"print risk detector — print.risk_detector","text":"S3 method format output risk detector gd().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print risk detector — print.risk_detector","text":"","code":"# S3 method for risk_detector print(x, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print risk detector — print.risk_detector","text":"x Return gd(). ... arguments.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print risk detector — print.risk_detector","text":"Formatted string output","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/print.risk_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"print risk detector — print.risk_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":null,"dir":"Reference","previous_headings":"","what":"robust geographical detector(RGD) model — rgd","title":"robust geographical detector(RGD) model — rgd","text":"Function robust geographical detector(RGD) model.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"robust geographical detector(RGD) model — rgd","text":"","code":"rgd( formula, data, discvar, discnum = NULL, minsize = NULL, cores = 1, type = \"factor\", alpha = 0.95, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"robust geographical detector(RGD) model — rgd","text":"formula formula RGD model. data data.frame tibble observation data. discvar Name continuous variable columns need discretized.Noted formula discvar, data must columns. discnum numeric vector discretized classes columns need discretized. Default discvar use 10. minsize (optional) min size discretization group.Default use 1. cores (optional) Positive integer(default 1). cores > 1, use python's joblib package parallel computation. type (optional) type geographical detector,must factor(default), interaction, risk, ecological.can run one time. alpha (optional) Specifies size confidence level.Default 0.95. ... (optional) arguments passed robust_disc().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"robust geographical detector(RGD) model — rgd","text":"list RGD model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"robust geographical detector(RGD) model — rgd","text":"Zhang, Z., Song, Y.*, & Wu, P., 2022. Robust geographical detector. International Journal Applied Earth Observation Geoinformation. 109, 102782. DOI: 10.1016/j.jag.2022.102782.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"robust geographical detector(RGD) model — rgd","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/rgd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"robust geographical detector(RGD) model — rgd","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) rgd(fvc ~ ., data = fvc, discnum = 10, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type =c('factor','interaction')) }"},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":null,"dir":"Reference","previous_headings":"","what":"risk detector — risk_detector","title":"risk detector — risk_detector","text":"Determine whether significant difference attribute means two subregions.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"risk detector — risk_detector","text":"","code":"risk_detector(y, x, alpha = 0.95)"},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"risk detector — risk_detector","text":"y Variable Y, continuous numeric vector. x Covariate X, factor, character discrete numeric. alpha (optional) Confidence level interval,default 0.95.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"risk detector — risk_detector","text":"tibble contains different combinations covariate X level student t-test statistics, degrees freedom, p-values, whether risk (Yes ).","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/risk_detector.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"risk detector — risk_detector","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":null,"dir":"Reference","previous_headings":"","what":"univariate discretization based on offline change point detection. — robust_disc","title":"univariate discretization based on offline change point detection. — robust_disc","text":"Determines discretization interval breaks using optimization algorithm variance-based change point detection.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"univariate discretization based on offline change point detection. — robust_disc","text":"","code":"robust_disc(formula, data, discnum, minsize = NULL, cores = 1)"},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"univariate discretization based on offline change point detection. — robust_disc","text":"formula formula spatial stratified heterogeneity test. data data.frame tibble observation data. discnum numeric vector discretized classes columns need discretized. minsize (optional) min size discretization group.Default use 1. cores (optional) Positive integer(default 1). cores > 1, use python's joblib package parallel computation.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"univariate discretization based on offline change point detection. — robust_disc","text":"tibble discretized classes columns need discretized.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"univariate discretization based on offline change point detection. — robust_disc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/robust_disc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"univariate discretization based on offline change point detection. — robust_disc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = \"https://github.com/SpatLyu/rdevdata/raw/main/FVC.tif\" fvc = terra::rast(paste0(\"/vsicurl/\",fvcpath)) fvc = terra::aggregate(fvc,fact = 5) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) new.fvc = robust_disc(fvc ~ .,data = select(fvc,-lulc),discnum = 10,cores = 6) new.fvc }"},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":null,"dir":"Reference","previous_headings":"","what":"univariate discretization — st_unidisc","title":"univariate discretization — st_unidisc","text":"Function classify univariate vector interval,wrapper classInt::classify_intervals().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"univariate discretization — st_unidisc","text":"","code":"st_unidisc(x, k, method = \"quantile\", factor = FALSE, seed = 12345678, ...)"},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"univariate discretization — st_unidisc","text":"x continuous numerical variable. k (optional) Number classes required, missing, grDevices::nclass.Sturges() used; see also \"dpih\" \"headtails\" styles automatic choice number classes. k must greater 3 ! method Chosen classify style: one \"fixed\", \"sd\", \"equal\", \"pretty\", \"quantile\", \"kmeans\", \"hclust\", \"bclust\", \"fisher\", \"jenks\", \"dpih\", \"headtails\", \"maximum\", \"box\".Default quantile. factor (optional) Default FALSE, TRUE returns cols factor intervals labels rather integers. seed (optional) Random seed number, default 12345678.Setting random seed useful sample size greater 3000(default value largeN) data discretized sampling 10%(default value samp_prop). ... (optional) arguments passed classInt::classify_intervals(), see ?classInt::classify_intervals().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"univariate discretization — st_unidisc","text":"discrete vectors classified.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"univariate discretization — st_unidisc","text":"Wenbo Lv lyu.geosocial@gmail.com","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/st_unidisc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"univariate discretization — st_unidisc","text":"","code":"xvar = c(22361, 9573, 4836, 5309, 10384, 4359, 11016, 4414, 3327, 3408, 17816, 6909, 6936, 7990, 3758, 3569, 21965, 3605, 2181, 1892, 2459, 2934, 6399, 8578, 8537, 4840, 12132, 3734, 4372, 9073, 7508, 5203) st_unidisc(xvar,k = 6,method = 'sd') #> [1] 5 3 2 2 3 2 3 2 2 2 5 2 2 3 2 2 5 2 2 1 2 2 2 3 3 2 3 2 2 3 3 2"},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"gdverse-development-version","dir":"Changelog","previous_headings":"","what":"gdverse (development version)","title":"gdverse (development version)","text":"Support geodetector model variants fix bugs gdverse.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-3","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.3","text":"Support GOZH model.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-2","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.2","text":"Solve computational stability problem OPGD model.","code":""},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/news/index.html","id":"major-changes-0-0-1","dir":"Changelog","previous_headings":"","what":"Major changes","title":"gdverse 0.0.1","text":"Can now work well OPGD RGD model.","code":""}]