Articles
+
Articles
Authors and Citation
+
Authors and Citation
The goal of gdverse is to support the geodetector model and its variants.
@@ -108,7 +117,7 @@OPGD modeltictoc::tic() g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6) tictoc::toc() -## 14.33 sec elapsed
new.fvc = bind_cols(select(fvc,fvc,lulc),g$disv)
gd(fvc ~ .,data = new.fvc,type = 'factor')
@@ -124,8 +133,8 @@ OPGD model
presum
-0.6404
-6.057e-10
+0.642
+8.298e-10
lulc
@@ -134,13 +143,13 @@ OPGD model
premin
-0.4381
-5.372e-10
+0.4423
+8.29e-10
tmpmin
-0.407
-8.491e-10
+0.4065
+4.706e-10
tmpmax
@@ -149,18 +158,18 @@ OPGD model
elev
-0.209
-1.5e-10
+0.2089
+3.485e-10
tmpavg
-0.1972
-3.432e-10
+0.197
+6.833e-10
slope
-0.1945
-4.206e-10
+0.1937
+8.865e-10
pop
@@ -169,13 +178,13 @@ OPGD model
premax
-0.133
-3.39e-10
+0.134
+2.764e-10
ntl
-0.02159
-6.877e-10
+0.0216
+5.971e-10
aspect
@@ -285,7 +294,7 @@ OPGD model
elev ∩ pop
-Enhance, bi-
+Enhance, nonlinear
elev ∩ premax
diff --git a/logo.png b/logo.png
new file mode 100644
index 00000000..761f76b8
Binary files /dev/null and b/logo.png differ
diff --git a/pkgdown.yml b/pkgdown.yml
index 1ba5e102..720c1e30 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -3,7 +3,7 @@ pkgdown: 2.0.9
pkgdown_sha: ~
articles:
OPGD: OPGD.html
-last_built: 2024-06-06T17:25Z
+last_built: 2024-06-07T04:10Z
urls:
reference: https://spatlyu.github.io/gdverse/reference
article: https://spatlyu.github.io/gdverse/articles
diff --git a/reference/ecological_detector.html b/reference/ecological_detector.html
index c9388d27..e901ea25 100644
--- a/reference/ecological_detector.html
+++ b/reference/ecological_detector.html
@@ -1,5 +1,5 @@
-ecological detector — ecological_detector • gdverse ecological detector — ecological_detector • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/factor_detector.html b/reference/factor_detector.html
index c317466c..7f8f3238 100644
--- a/reference/factor_detector.html
+++ b/reference/factor_detector.html
@@ -1,7 +1,7 @@
factor detector — factor_detector • gdverse
@@ -45,7 +45,7 @@
diff --git a/reference/figures/logo.png b/reference/figures/logo.png
new file mode 100644
index 00000000..761f76b8
Binary files /dev/null and b/reference/figures/logo.png differ
diff --git a/reference/gd.html b/reference/gd.html
index be395221..9969c1a4 100644
--- a/reference/gd.html
+++ b/reference/gd.html
@@ -1,5 +1,5 @@
-geographical detector model — gd • gdverse geographical detector model — gd • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/gd_bestunidisc.html b/reference/gd_bestunidisc.html
index c49b57a8..50099764 100644
--- a/reference/gd_bestunidisc.html
+++ b/reference/gd_bestunidisc.html
@@ -1,5 +1,5 @@
-Best univariate discretize parameters based on geodetector q-statistic — gd_bestunidisc • gdverse Best univariate discretize parameters based on geodetector q-statistic — gd_bestunidisc • gdverse
@@ -43,7 +43,7 @@
- ![]()
Best univariate discretize parameters based on geodetector q-statistic
+ 
Best univariate discretize parameters based on geodetector q-statistic
Source: R/discretization.R
gd_bestunidisc.Rd
@@ -57,10 +57,11 @@ Usage
gd_bestunidisc(
formula,
data,
- discnum,
+ discnum = NULL,
discmethod = NULL,
cores = 1,
return_disc = TRUE,
+ seed = 12345678,
...
)
@@ -76,7 +77,7 @@ ArgumentsArgumentsst_unidisc().
@@ -122,8 +127,8 @@ Examplesg = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6)
new.fvc = g$disv
new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc)
-ssh.test(fvc ~ .,data = new.fvc,type = 'factor')
-ssh.test(fvc ~ .,data = new.fvc,type = 'interaction')
+gd(fvc ~ .,data = new.fvc,type = 'factor')
+gd(fvc ~ .,data = new.fvc,type = 'interaction')
}
diff --git a/reference/index.html b/reference/index.html
index cc2c2c82..03b95560 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -1,5 +1,5 @@
-Function reference • gdverse Function reference • gdverse
@@ -43,7 +43,7 @@
- ![]()
Function reference
+ 
Function reference
@@ -84,6 +84,11 @@ All functionsopgd()
+
+ optimal parameters geographic detector(OPGD) model
+ -
+
print(<ecological_detector>)
- print ecological detector
diff --git a/reference/interaction_detector.html b/reference/interaction_detector.html
index c238f2f8..43054f9a 100644
--- a/reference/interaction_detector.html
+++ b/reference/interaction_detector.html
@@ -1,9 +1,9 @@
interaction detector — interaction_detector • gdverse interaction detector — interaction_detector • gdverse
@@ -47,7 +47,7 @@
diff --git a/reference/opgd.html b/reference/opgd.html
new file mode 100644
index 00000000..4ccda09d
--- /dev/null
+++ b/reference/opgd.html
@@ -0,0 +1,157 @@
+
+optimal parameters geographic detector(OPGD) model — opgd • gdverse
+ Skip to contents
+
+
+
+
+
+
+
+ Function for optimal parameters geographic detector(OPGD) model.
+
+
+
+ Usage
+ opgd(
+ formula,
+ data,
+ discvar,
+ discnum = NULL,
+ discmethod = NULL,
+ cores = 1,
+ type = "factor",
+ alpha = 0.95,
+ ...
+)
+
+
+
+ Arguments
+ - formula
+A formula of OPGD model.
+
+
+- data
+A data.frame or tibble of observation data.
+
+
+- discvar
+Name of continuous variable columns that need to be discretized.Noted that
+when formula
has discvar
, data
must have these columns.
+
+
+- discnum
+(optional) A vector of number of classes for discretization. Default is 2:15
.
+
+
+- discmethod
+(optional) A vector of methods for discretization,default is used
+c("sd","equal","pretty","quantile","fisher","headtails","maximum","box")
in spEcula
.
+
+
+- cores
+positive integer(default is 1). If cores > 1, a 'parallel' package
+cluster with that many cores is created and used. You can also supply a cluster
+object.
+
+
+- type
+(optional) The type of geographical detector,which must be factor
(default),
+interaction
, risk
, ecological
.You can run one or more at a time.
+
+
+- alpha
+(optional) Specifies the size of confidence level.Default is 0.95
.
+
+
+- ...
+(optional) Other arguments passed to gd_bestunidisc()
.
+
+
+
+
+ Author
+ Wenbo Lv lyu.geosocial@gmail.com
+
+
+
+ Examples
+ if (FALSE) {
+library(terra)
+library(tidyverse)
+fvcpath = system.file("extdata", "FVC.zip",package = 'spEcula')
+fvc = terra::rast(paste0("/vsizip/",fvcpath))
+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`))
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/print.ecological_detector.html b/reference/print.ecological_detector.html
index d5c387cd..32b2e901 100644
--- a/reference/print.ecological_detector.html
+++ b/reference/print.ecological_detector.html
@@ -1,5 +1,5 @@
-print ecological detector — print.ecological_detector • gdverse print ecological detector — print.ecological_detector • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/print.factor_detector.html b/reference/print.factor_detector.html
index 40b77ecb..6645d219 100644
--- a/reference/print.factor_detector.html
+++ b/reference/print.factor_detector.html
@@ -1,5 +1,5 @@
-print factor detector — print.factor_detector • gdverse print factor detector — print.factor_detector • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/print.interaction_detector.html b/reference/print.interaction_detector.html
index 26f6ea81..a7d58b0d 100644
--- a/reference/print.interaction_detector.html
+++ b/reference/print.interaction_detector.html
@@ -1,5 +1,5 @@
-print interaction detector — print.interaction_detector • gdverse print interaction detector — print.interaction_detector • gdverse
@@ -43,7 +43,7 @@
- ![]()
print interaction detector
+ 
print interaction detector
Source: R/gd.R
print.interaction_detector.Rd
diff --git a/reference/print.risk_detector.html b/reference/print.risk_detector.html
index 3cbbafdc..ea13d6e2 100644
--- a/reference/print.risk_detector.html
+++ b/reference/print.risk_detector.html
@@ -1,5 +1,5 @@
-print risk detector — print.risk_detector • gdverse print risk detector — print.risk_detector • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/risk_detector.html b/reference/risk_detector.html
index ad97f109..b13fd13b 100644
--- a/reference/risk_detector.html
+++ b/reference/risk_detector.html
@@ -1,5 +1,5 @@
-risk detector — risk_detector • gdverse risk detector — risk_detector • gdverse
@@ -43,7 +43,7 @@
diff --git a/reference/st_unidisc.html b/reference/st_unidisc.html
index 981ca2bd..dc240d58 100644
--- a/reference/st_unidisc.html
+++ b/reference/st_unidisc.html
@@ -1,5 +1,5 @@
-Univariate discretization — st_unidisc • gdverse Univariate discretization — st_unidisc • gdverse
@@ -43,7 +43,7 @@
diff --git a/search.json b/search.json
index 675d90ee..e187a5d7 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 geographic 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 ## class : SpatRaster ## dimensions : 418, 568, 13 (nrow, ncol, nlyr) ## resolution : 1000, 1000 (x, y) ## extent : -92742.16, 475257.8, 3591385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source : FVC.tif ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1363270, 109.8619, 2.00000, 3783.904, 9.289694, -11.971293, ... ## max values : 0.9596695, 249.9284, 82.74928, 8549.112, 26.781870, 1.322163, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" \"ntl\" ## [10] \"lulc\" \"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 geographic 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.198 163. 7.95 3956. 20.8 -7.53 8.05 1.90 6.60 10 1758. 2.65 176. ## 2 0.193 161. 6.80 3892. 20.7 -7.55 8.02 1.20 4.91 10 1754. 3.45 170. ## 3 0.192 160. 5.24 3842. 20.9 -7.48 8.15 0.547 3.75 10 1722. 3.96 139. ## 4 0.189 159. 5 3808. 21.1 -7.39 8.35 0.542 3.99 10 1672. 2.90 111. ## 5 0.208 164. 9.98 4051. 20.6 -7.59 7.97 10.4 7.10 10 1780. 1.94 99.5 ## 6 0.196 163. 8.15 3973. 20.7 -7.53 8.03 9.31 6.56 10 1755. 3.01 99.6"},{"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 geographic 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 = 2:15,cores = 6) tictoc::toc() ## 15.37 sec elapsed g ## $x ## [1] \"aspect\" \"elev\" \"ntl\" \"pop\" \"premax\" \"premin\" \"presum\" \"slope\" \"tmpavg\" ## [10] \"tmpmax\" \"tmpmin\" ## ## $k ## [1] 15 15 15 15 14 13 15 11 15 15 14 ## ## $method ## [1] \"equal\" \"quantile\" \"fisher\" \"quantile\" \"fisher\" \"fisher\" \"fisher\" ## [8] \"fisher\" \"quantile\" \"quantile\" \"fisher\" ## ## $disv ## # A tibble: 136,243 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 8 12 3 1 6 1 1 3 4 8 2 ## 2 8 12 2 1 6 1 1 4 4 8 2 ## 3 6 12 2 1 6 1 1 5 4 9 2 ## 4 5 12 2 1 6 1 1 4 5 10 2 ## 5 5 13 3 4 7 2 1 2 4 8 2 ## 6 5 12 3 3 6 1 1 4 4 8 2 ## 7 6 12 2 1 6 1 1 5 4 9 2 ## 8 7 12 2 1 6 1 1 4 5 10 3 ## 9 8 12 2 1 6 1 1 3 5 10 3 ## 10 7 12 2 1 6 1 1 4 5 10 3 ## # ℹ 136,233 more rows new.fvc = g$disv new.fvc ## # A tibble: 136,243 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 8 12 3 1 6 1 1 3 4 8 2 ## 2 8 12 2 1 6 1 1 4 4 8 2 ## 3 6 12 2 1 6 1 1 5 4 9 2 ## 4 5 12 2 1 6 1 1 4 5 10 2 ## 5 5 13 3 4 7 2 1 2 4 8 2 ## 6 5 12 3 3 6 1 1 4 4 8 2 ## 7 6 12 2 1 6 1 1 5 4 9 2 ## 8 7 12 2 1 6 1 1 4 5 10 3 ## 9 8 12 2 1 6 1 1 3 5 10 3 ## 10 7 12 2 1 6 1 1 4 5 10 3 ## # ℹ 136,233 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 136,243 × 13 ## fvc lulc aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 0.198 10 8 12 3 1 6 1 1 3 4 8 2 ## 2 0.193 10 8 12 2 1 6 1 1 4 4 8 2 ## 3 0.192 10 6 12 2 1 6 1 1 5 4 9 2 ## 4 0.189 10 5 12 2 1 6 1 1 4 5 10 2 ## 5 0.208 10 5 13 3 4 7 2 1 2 4 8 2 ## 6 0.196 10 5 12 3 3 6 1 1 4 4 8 2 ## 7 0.191 10 6 12 2 1 6 1 1 5 4 9 2 ## 8 0.185 10 7 12 2 1 6 1 1 4 5 10 3 ## 9 0.174 10 8 12 2 1 6 1 1 3 5 10 3 ## 10 0.166 10 7 12 2 1 6 1 1 4 5 10 3 ## # ℹ 136,233 more rows"},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"optimal parameters geographic 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/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: Geographic detector models. R package version 0.0.0.9900, https://github.com/SpatLyu/gdverse, https://spatlyu.github.io/gdverse/.","code":"@Manual{, title = {gdverse: Geographic detector models}, author = {Wenbo Lv}, year = {2024}, note = {R package version 0.0.0.9900, 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 :","code":"# install.packages(\"devtools\") devtools::install_github(\"SpatLyu/gdverse\",build_vignettes = T,dep = T)"},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"opgd-model","dir":"","previous_headings":"Example","what":"OPGD model","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 = 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.198 163. 7.95 3956. 20.8 -7.53 8.05 1.90 6.60 10 1758. 2.65 ## 2 0.193 161. 6.80 3892. 20.7 -7.55 8.02 1.20 4.91 10 1754. 3.45 ## 3 0.192 160. 5.24 3842. 20.9 -7.48 8.15 0.547 3.75 10 1722. 3.96 ## 4 0.189 159. 5 3808. 21.1 -7.39 8.35 0.542 3.99 10 1672. 2.90 ## 5 0.208 164. 9.98 4051. 20.6 -7.59 7.97 10.4 7.10 10 1780. 1.94 ## 6 0.196 163. 8.15 3973. 20.7 -7.53 8.03 9.31 6.56 10 1755. 3.01 ## # ℹ 1 more variable: aspect tictoc::tic() g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6) tictoc::toc() ## 14.33 sec elapsed new.fvc = bind_cols(select(fvc,fvc,lulc),g$disv) 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/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":"geographical detector model — gd","title":"geographical detector model — gd","text":"Classical geographical detector model","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"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":"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":"geographical detector model — gd","text":"tibble corresponding result stored corresponding detector type.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"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":"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 discretize parameters based on geodetector q-statistic — gd_bestunidisc","title":"Best univariate discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"Function determining best univariate discretize parameters 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 discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"","code":"gd_bestunidisc( formula, data, discnum, discmethod = NULL, cores = 1, return_disc = TRUE, ... )"},{"path":"https://spatlyu.github.io/gdverse/reference/gd_bestunidisc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Best univariate discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"formula formula spatial stratified heterogeneity test. data data.frame tibble observation data. discnum vector number classes discretization. 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. ... (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 discretize parameters 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 discretize parameters 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 discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = system.file(\"extdata\", \"FVC.zip\",package = 'spEcula') fvc = terra::rast(paste0(\"/vsizip/\",fvcpath)) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6) new.fvc = g$disv new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) ssh.test(fvc ~ .,data = new.fvc,type = 'factor') ssh.test(fvc ~ .,data = new.fvc,type = 'interaction') }"},{"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/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/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/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, ...)"},{"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. 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. ... (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] 9 4 3 3 5 2 5 2 2 2 8 3 3 4 2 2 9 2 2 1 2 2 3 4 4 3 5 2 2 4 4 3"}]
+[{"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 geographic 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 ## class : SpatRaster ## dimensions : 418, 568, 13 (nrow, ncol, nlyr) ## resolution : 1000, 1000 (x, y) ## extent : -92742.16, 475257.8, 3591385, 4009385 (xmin, xmax, ymin, ymax) ## coord. ref. : Asia_North_Albers_Equal_Area_Conic ## source : FVC.tif ## names : fvc, premax, premin, presum, tmpmax, tmpmin, ... ## min values : 0.1363270, 109.8619, 2.00000, 3783.904, 9.289694, -11.971293, ... ## max values : 0.9596695, 249.9284, 82.74928, 8549.112, 26.781870, 1.322163, ... names(fvc) ## [1] \"fvc\" \"premax\" \"premin\" \"presum\" \"tmpmax\" \"tmpmin\" \"tmpavg\" \"pop\" ## [9] \"ntl\" \"lulc\" \"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 geographic 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 ## ## 1 0.198 163. 7.95 3956. 20.8 -7.53 8.05 1.90 6.60 10 1758. ## 2 0.193 161. 6.80 3892. 20.7 -7.55 8.02 1.20 4.91 10 1754. ## 3 0.192 160. 5.24 3842. 20.9 -7.48 8.15 0.547 3.75 10 1722. ## 4 0.189 159. 5 3808. 21.1 -7.39 8.35 0.542 3.99 10 1672. ## 5 0.208 164. 9.98 4051. 20.6 -7.59 7.97 10.4 7.10 10 1780. ## 6 0.196 163. 8.15 3973. 20.7 -7.53 8.03 9.31 6.56 10 1755. ## # ℹ 2 more variables: slope , aspect "},{"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 geographic 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 = 2:15,cores = 6) tictoc::toc() ## 17.28 sec elapsed g ## $x ## [1] \"aspect\" \"elev\" \"ntl\" \"pop\" \"premax\" \"premin\" \"presum\" \"slope\" ## [9] \"tmpavg\" \"tmpmax\" \"tmpmin\" ## ## $k ## [1] 15 15 15 15 15 13 15 13 15 15 15 ## ## $method ## [1] \"equal\" \"quantile\" \"fisher\" \"quantile\" \"quantile\" \"fisher\" ## [7] \"fisher\" \"fisher\" \"fisher\" \"quantile\" \"fisher\" ## ## $disv ## # A tibble: 136,243 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 8 12 3 1 9 1 1 4 6 8 2 ## 2 8 12 2 1 8 1 1 5 6 8 2 ## 3 6 12 2 1 8 1 1 6 6 9 2 ## 4 5 12 2 1 8 1 1 4 7 10 2 ## 5 5 13 3 4 9 2 1 3 6 8 2 ## 6 5 12 3 3 9 1 1 4 6 8 2 ## 7 6 12 2 1 8 1 1 6 6 9 2 ## 8 7 12 2 1 8 1 1 5 7 10 2 ## 9 8 12 2 1 8 1 1 3 7 10 2 ## 10 7 12 3 1 8 1 1 4 7 10 2 ## # ℹ 136,233 more rows new.fvc = g$disv new.fvc ## # A tibble: 136,243 × 11 ## aspect elev ntl pop premax premin presum slope tmpavg tmpmax tmpmin ## ## 1 8 12 3 1 9 1 1 4 6 8 2 ## 2 8 12 2 1 8 1 1 5 6 8 2 ## 3 6 12 2 1 8 1 1 6 6 9 2 ## 4 5 12 2 1 8 1 1 4 7 10 2 ## 5 5 13 3 4 9 2 1 3 6 8 2 ## 6 5 12 3 3 9 1 1 4 6 8 2 ## 7 6 12 2 1 8 1 1 6 6 9 2 ## 8 7 12 2 1 8 1 1 5 7 10 2 ## 9 8 12 2 1 8 1 1 3 7 10 2 ## 10 7 12 3 1 8 1 1 4 7 10 2 ## # ℹ 136,233 more rows new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) new.fvc ## # A tibble: 136,243 × 13 ## fvc lulc aspect elev ntl pop premax premin presum slope tmpavg ## ## 1 0.198 10 8 12 3 1 9 1 1 4 6 ## 2 0.193 10 8 12 2 1 8 1 1 5 6 ## 3 0.192 10 6 12 2 1 8 1 1 6 6 ## 4 0.189 10 5 12 2 1 8 1 1 4 7 ## 5 0.208 10 5 13 3 4 9 2 1 3 6 ## 6 0.196 10 5 12 3 3 9 1 1 4 6 ## 7 0.191 10 6 12 2 1 8 1 1 6 6 ## 8 0.185 10 7 12 2 1 8 1 1 5 7 ## 9 0.174 10 8 12 2 1 8 1 1 3 7 ## 10 0.166 10 7 12 3 1 8 1 1 4 7 ## # ℹ 136,233 more rows ## # ℹ 2 more variables: tmpmax , tmpmin "},{"path":"https://spatlyu.github.io/gdverse/articles/OPGD.html","id":"run-geodetector","dir":"Articles","previous_headings":"","what":"Run geodetector","title":"optimal parameters geographic 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 geographic detector(OPGD)","text":"","code":"fvc_gd = opgd(fvc ~ .,data = fvc, discvar = names(select(fvc,-c(fvc,lulc))), cores = 6, type = c(`factor`,`interaction`)) str(fvc_gd) ## 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.642 0.553 0.443 0.403 0.228 ... ## .. ..$ P-value : num [1:12] 8.30e-10 9.11e-10 8.56e-10 4.82e-10 5.11e-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.553 0.553 0.553 0.553 0.553 ... ## .. ..$ Variable2 Q-statistics : num [1:66] 0.00741 0.20903 0.02171 0.18561 0.13244 ... ## .. ..$ Variable1 and Variable2 interact Q-statistics: num [1:66] 0.563 0.739 0.611 0.636 0.677 ... ## ..- attr(*, \"class\")= chr \"interaction_detector\" fvc_gd[[1]] ## Spatial Stratified Heterogeneity Test ## ## Factor detector fvc_gd[[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: Geographic detector models. R package version 0.0.0.9900, https://github.com/SpatLyu/gdverse, https://spatlyu.github.io/gdverse/.","code":"@Manual{, title = {gdverse: Geographic detector models}, author = {Wenbo Lv}, year = {2024}, note = {R package version 0.0.0.9900, 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 :","code":"# install.packages(\"devtools\") devtools::install_github(\"SpatLyu/gdverse\",build_vignettes = T,dep = T)"},{"path":[]},{"path":"https://spatlyu.github.io/gdverse/index.html","id":"opgd-model","dir":"","previous_headings":"Example","what":"OPGD model","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 = 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.198 163. 7.95 3956. 20.8 -7.53 8.05 1.90 6.60 10 1758. 2.65 ## 2 0.193 161. 6.80 3892. 20.7 -7.55 8.02 1.20 4.91 10 1754. 3.45 ## 3 0.192 160. 5.24 3842. 20.9 -7.48 8.15 0.547 3.75 10 1722. 3.96 ## 4 0.189 159. 5 3808. 21.1 -7.39 8.35 0.542 3.99 10 1672. 2.90 ## 5 0.208 164. 9.98 4051. 20.6 -7.59 7.97 10.4 7.10 10 1780. 1.94 ## 6 0.196 163. 8.15 3973. 20.7 -7.53 8.03 9.31 6.56 10 1755. 3.01 ## # ℹ 1 more variable: aspect tictoc::tic() g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6) tictoc::toc() ## 16.66 sec elapsed new.fvc = bind_cols(select(fvc,fvc,lulc),g$disv) 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/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":"geographical detector model — gd","title":"geographical detector model — gd","text":"Classical geographical detector model","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"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":"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":"geographical detector model — gd","text":"tibble corresponding result stored corresponding detector type.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/gd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"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":"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 discretize parameters based on geodetector q-statistic — gd_bestunidisc","title":"Best univariate discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"Function determining best univariate discretize parameters 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 discretize parameters 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 discretize parameters 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 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. return_disc (optional) Whether return discretized result used optimal parameter. Default TRUE. seed (optional) Random number seed, default 12345678 ... (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 discretize parameters 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 discretize parameters 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 discretize parameters based on geodetector q-statistic — gd_bestunidisc","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = system.file(\"extdata\", \"FVC.zip\",package = 'spEcula') fvc = terra::rast(paste0(\"/vsizip/\",fvcpath)) fvc = as_tibble(terra::as.data.frame(fvc,na.rm = T)) g = gd_bestunidisc(fvc ~ .,data = select(fvc,-lulc),discnum = 2:15,cores = 6) new.fvc = g$disv new.fvc = bind_cols(select(fvc,fvc,lulc),new.fvc) gd(fvc ~ .,data = new.fvc,type = 'factor') gd(fvc ~ .,data = new.fvc,type = 'interaction') }"},{"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 geographic detector(OPGD) model — opgd","title":"optimal parameters geographic detector(OPGD) model — opgd","text":"Function optimal parameters geographic 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 geographic 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 geographic 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 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. 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().","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"optimal parameters geographic detector(OPGD) model — opgd","text":"list opgd model result.","code":""},{"path":"https://spatlyu.github.io/gdverse/reference/opgd.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"optimal parameters geographic 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 geographic detector(OPGD) model — opgd","text":"","code":"if (FALSE) { library(terra) library(tidyverse) fvcpath = system.file(\"extdata\", \"FVC.zip\",package = 'spEcula') fvc = terra::rast(paste0(\"/vsizip/\",fvcpath)) 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/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/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/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, ...)"},{"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. 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. ... (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] 9 4 3 3 5 2 5 2 2 2 8 3 3 4 2 2 9 2 2 1 2 2 3 4 4 3 5 2 2 4 4 3"}]
diff --git a/sitemap.xml b/sitemap.xml
index aa2760a5..204617b9 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -33,6 +33,9 @@
https://spatlyu.github.io/gdverse/reference/interaction_detector.html
+
+ https://spatlyu.github.io/gdverse/reference/opgd.html
+
https://spatlyu.github.io/gdverse/reference/print.ecological_detector.html