From 3af76d5a6d21c33f1a1984e79a65feb51b15db10 Mon Sep 17 00:00:00 2001 From: SpatLyu Date: Thu, 9 Jan 2025 11:31:06 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20stscl/sd?= =?UTF-8?q?sfun@e552005d6bac0a8ca4b3c51e7d5e2088eda794f6=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgdown.yml | 2 +- reference/fuzzyoverlay.html | 7 ++++--- search.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgdown.yml b/pkgdown.yml index 3b16305..a23e632 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2025-01-06T16:26Z +last_built: 2025-01-09T11:30Z urls: reference: https://stscl.github.io/sdsfun/reference article: https://stscl.github.io/sdsfun/articles diff --git a/reference/fuzzyoverlay.html b/reference/fuzzyoverlay.html index 0c9ace4..da9d8ce 100644 --- a/reference/fuzzyoverlay.html +++ b/reference/fuzzyoverlay.html @@ -76,17 +76,18 @@

Note

Examples

-
sim = tibble::tibble(y = stats::runif(7,0,10),
+    
set.seed(42)
+sim = tibble::tibble(y = stats::runif(7,0,10),
                      x1 = c(1,rep(2,3),rep(3,3)),
                      x2 = c(rep(1,2),rep(2,2),rep(3,3)))
 fo1 = fuzzyoverlay(y~x1+x2,data = sim, method = 'and')
 fo1
 #>      1      2      3      4      5      6      7 
-#> "x2_1" "x1_2" "x1_2" "x1_2" "x1_3" "x1_3" "x1_3" 
+#> "x1_1" "x1_2" "x2_2" "x2_2" "x1_3" "x1_3" "x1_3" 
 fo2 = fuzzyoverlay(y~x1+x2,data = sim, method = 'or')
 fo2
 #>      1      2      3      4      5      6      7 
-#> "x1_1" "x2_1" "x2_2" "x2_2" "x1_3" "x1_3" "x1_3" 
+#> "x2_1" "x2_1" "x1_2" "x1_2" "x1_3" "x1_3" "x1_3" 
 
 
diff --git a/search.json b/search.json index d21dc80..8040f7c 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://stscl.github.io/sdsfun/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Wenbo Lv. Author, maintainer, copyright holder.","code":""},{"path":"https://stscl.github.io/sdsfun/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lv W (2025). sdsfun: Spatial Data Science Complementary Features. R package version 0.7.0, https://github.com/stscl/sdsfun, https://stscl.github.io/sdsfun/.","code":"@Manual{, title = {sdsfun: Spatial Data Science Complementary Features}, author = {Wenbo Lv}, year = {2025}, note = {R package version 0.7.0, https://github.com/stscl/sdsfun}, url = {https://stscl.github.io/sdsfun/}, }"},{"path":"https://stscl.github.io/sdsfun/index.html","id":"sdsfun-","dir":"","previous_headings":"","what":"sdsfun | Spatial Data Science Complementary Features\n","title":"sdsfun | Spatial Data Science Complementary Features\n","text":"Spatial Data Science Complementary Features","code":""},{"path":"https://stscl.github.io/sdsfun/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"sdsfun | Spatial Data Science Complementary Features\n","text":"Install CRAN : Install development binary version R-universe : Install development source version GitHub :","code":"install.packages(\"sdsfun\") install.packages('sdsfun', repos = c(\"https://stscl.r-universe.dev\", \"https://cloud.r-project.org\"), dep = TRUE) # install.packages(\"devtools\") devtools::install_github(\"stscl/sdsfun\", dep = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":null,"dir":"Reference","previous_headings":"","what":"check for NA values in a tibble — check_tbl_na","title":"check for NA values in a tibble — check_tbl_na","text":"check NA values tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check for NA values in a tibble — check_tbl_na","text":"","code":"check_tbl_na(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check for NA values in a tibble — check_tbl_na","text":"tbl tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check for NA values in a tibble — check_tbl_na","text":"logical value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"check for NA values in a tibble — check_tbl_na","text":"","code":"demotbl = tibble::tibble(x = c(1,2,3,NA,1), y = c(NA,NA,1:3), z = 1:5) demotbl #> # A tibble: 5 × 3 #> x y z #> #> 1 1 NA 1 #> 2 2 NA 2 #> 3 3 1 3 #> 4 NA 2 4 #> 5 1 3 5 check_tbl_na(demotbl) #> [1] TRUE"},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"discretization — discretize_vector","title":"discretization — discretize_vector","text":"discretization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"discretization — discretize_vector","text":"","code":"discretize_vector( x, n, method = \"natural\", breakpoint = NULL, sampleprob = 0.15, seed = 123456789 )"},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"discretization — discretize_vector","text":"x continuous numeric vector. n (optional) number discretized classes. method (optional) method discretization, default natural. breakpoint (optional) Break points manually splitting data. method manual, breakpoint required. sampleprob (optional) data size exceeds 3000, perform sampling discretization, applicable natural breaks. Default 0.15. seed (optional) Random seed number, default 123456789.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"discretization — discretize_vector","text":"discretized integer vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"discretization — discretize_vector","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) discretize_vector(xvar, n = 5, method = 'natural') #> [1] 5 4 2 3 4 2 4 2 1 1 5 3 3 3 2 1 5 1 1 1 1 1 3 3 3 2 5 1 2 4 3 2"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"transforming category tibble corresponding dummy variable tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"","code":"dummy_tbl(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"tbl tibble data.frame.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"","code":"a = tibble::tibble(x = 1:3,y = 4:6) dummy_tbl(a) #> # A tibble: 3 × 4 #> x_1 x_2 y_1 y_2 #> #> 1 1 0 1 0 #> 2 0 1 0 1 #> 3 0 0 0 0"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"transforming a categorical variable into dummy variables — dummy_vec","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"transforming categorical variable dummy variables","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"","code":"dummy_vec(x)"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"x integer vector can converted integer vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"","code":"dummy_vec(c(1,1,3,2,4,6)) #> [,1] [,2] [,3] [,4] #> [1,] 1 0 0 0 #> [2,] 1 0 0 0 #> [3,] 0 1 0 0 #> [4,] 0 0 1 0 #> [5,] 0 0 0 1 #> [6,] 0 0 0 0"},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":null,"dir":"Reference","previous_headings":"","what":"get variable names in a formula and data — formula_varname","title":"get variable names in a formula and data — formula_varname","text":"get variable names formula data","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"get variable names in a formula and data — formula_varname","text":"","code":"formula_varname(formula, data)"},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"get variable names in a formula and data — formula_varname","text":"formula formula. data data.frame, tibble sf object observation data.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"get variable names in a formula and data — formula_varname","text":"list. yname Independent variable name xname Dependent variable names","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"get variable names in a formula and data — formula_varname","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) formula_varname(PS_Score ~ EL_Score + OH_Score, gzma) #> $yname #> [1] \"PS_Score\" #> #> $xname #> [1] \"EL_Score\" \"OH_Score\" #> formula_varname(PS_Score ~ ., gzma) #> $yname #> [1] \"PS_Score\" #> #> $xname #> [1] \"EL_Score\" \"OH_Score\" \"IL_Score\" #>"},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial fuzzy overlay — fuzzyoverlay","title":"spatial fuzzy overlay — fuzzyoverlay","text":"spatial fuzzy overlay","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial fuzzy overlay — fuzzyoverlay","text":"","code":"fuzzyoverlay(formula, data, method = \"and\")"},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial fuzzy overlay — fuzzyoverlay","text":"formula formula spatial fuzzy overlay. data data.frame tibble discretized data. method (optional) Overlay methods. method , use min fuzzy overlay; method ,use max fuzzy overlay. Default .","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial fuzzy overlay — fuzzyoverlay","text":"numeric vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"spatial fuzzy overlay — fuzzyoverlay","text":"Independent variables data provided fuzzyoverlay() must discretized variables, dependent variable continuous variable.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial fuzzy overlay — fuzzyoverlay","text":"","code":"sim = tibble::tibble(y = stats::runif(7,0,10), x1 = c(1,rep(2,3),rep(3,3)), x2 = c(rep(1,2),rep(2,2),rep(3,3))) fo1 = fuzzyoverlay(y~x1+x2,data = sim, method = 'and') fo1 #> 1 2 3 4 5 6 7 #> \"x2_1\" \"x1_2\" \"x1_2\" \"x1_2\" \"x1_3\" \"x1_3\" \"x1_3\" fo2 = fuzzyoverlay(y~x1+x2,data = sim, method = 'or') fo2 #> 1 2 3 4 5 6 7 #> \"x1_1\" \"x2_1\" \"x2_2\" \"x2_2\" \"x1_3\" \"x1_3\" \"x1_3\""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":null,"dir":"Reference","previous_headings":"","what":"generate subsets of a set — generate_subsets","title":"generate subsets of a set — generate_subsets","text":"generate subsets set","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generate subsets of a set — generate_subsets","text":"","code":"generate_subsets(set, empty = TRUE, self = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generate subsets of a set — generate_subsets","text":"set vector. empty (optional) empty TRUE, generated subset includes empty set, otherwise empty set removed. Default TRUE. self (optional) self TRUE, resulting subset includes set , otherwise set removed. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generate subsets of a set — generate_subsets","text":"list.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generate subsets of a set — generate_subsets","text":"","code":"generate_subsets(letters[1:3]) #> [[1]] #> NULL #> #> [[2]] #> [1] \"a\" #> #> [[3]] #> [1] \"b\" #> #> [[4]] #> [1] \"c\" #> #> [[5]] #> [1] \"a\" \"b\" #> #> [[6]] #> [1] \"a\" \"c\" #> #> [[7]] #> [1] \"b\" \"c\" #> #> [[8]] #> [1] \"a\" \"b\" \"c\" #> generate_subsets(letters[1:3],empty = FALSE) #> [[1]] #> [1] \"a\" #> #> [[2]] #> [1] \"b\" #> #> [[3]] #> [1] \"c\" #> #> [[4]] #> [1] \"a\" \"b\" #> #> [[5]] #> [1] \"a\" \"c\" #> #> [[6]] #> [1] \"b\" \"c\" #> #> [[7]] #> [1] \"a\" \"b\" \"c\" #> generate_subsets(letters[1:3],self = FALSE) #> [[1]] #> NULL #> #> [[2]] #> [1] \"a\" #> #> [[3]] #> [1] \"b\" #> #> [[4]] #> [1] \"c\" #> #> [[5]] #> [1] \"a\" \"b\" #> #> [[6]] #> [1] \"a\" \"c\" #> #> [[7]] #> [1] \"b\" \"c\" #> generate_subsets(letters[1:3],empty = FALSE,self = FALSE) #> [[1]] #> [1] \"a\" #> #> [[2]] #> [1] \"b\" #> #> [[3]] #> [1] \"c\" #> #> [[4]] #> [1] \"a\" \"b\" #> #> [[5]] #> [1] \"a\" \"c\" #> #> [[6]] #> [1] \"b\" \"c\" #>"},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":null,"dir":"Reference","previous_headings":"","what":"only geodetector q-value — geodetector_q","title":"only geodetector q-value — geodetector_q","text":"geodetector q-value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"only geodetector q-value — geodetector_q","text":"","code":"geodetector_q(y, hs)"},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"only geodetector q-value — geodetector_q","text":"y Dependent variable hs Independent variable","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"only geodetector q-value — geodetector_q","text":"numeric value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"only geodetector q-value — geodetector_q","text":"","code":"geodetector_q(y = 1:7, hs = c('x',rep('y',3),rep('z',3))) #> [1] 0.8571429"},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":null,"dir":"Reference","previous_headings":"","what":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"hierarchical clustering spatial soft constraints","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"","code":"hclustgeo_disc( data, n, alpha = 0.5, D1 = NULL, hclustm = \"ward.D2\", scale = TRUE, wt = NULL, ... )"},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"data sf object, tibble, data.frame, matrix vector observations data. n number hierarchical clustering classes, can numeric value vector. alpha (optional) positive value 0 1. mixing parameter gives relative importance \"feature\" space \"constraint\" space. Default 0.5. D1 (optional) matrix dissimilarities observations data. data sf object alpha 0, D1 generated sdsfun::sf_distance_matrix(), others use matrix elements equal 0. hclustm (optional) agglomeration method used, default ward.D2. details, please see stats::hclust(). scale (optional) Whether scaled dissimilarities matrix, default TRUE. wt (optional) Vector weights observations. default, wt NULL. ... (optional) arguments passed stats::dist().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"grouped membership: vector n scalar, matrix (columns correspond elements n) .","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"C++ enhanced implementation hclustgeo function ClustGeo package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) gzma$group = hclustgeo_disc(gzma,5,alpha = 0.75) plot(gzma[\"group\"])"},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"construct inverse distance weight — inverse_distance_swm","title":"construct inverse distance weight — inverse_distance_swm","text":"Function constructing inverse distance weight.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"construct inverse distance weight — inverse_distance_swm","text":"","code":"inverse_distance_swm(sfj, power = 1, bandwidth = NULL)"},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"construct inverse distance weight — inverse_distance_swm","text":"sfj Vector object can converted sf sf::st_as_sf(). power (optional) Default 1. Set 2 gravity weights. bandwidth (optional) distance bigger bandwidth, corresponding part weight matrix set 0. Default NULL, means use bandwidth.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"construct inverse distance weight — inverse_distance_swm","text":"inverse distance weight matrices class matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"construct inverse distance weight — inverse_distance_swm","text":"inverse distance weight formula \\(w_{ij} = 1 / d_{ij}^\\alpha\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"construct inverse distance weight — inverse_distance_swm","text":"","code":"library(sf) #> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE pts = read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) wt = inverse_distance_swm(pts) wt[1:5,1:5] #> 1 2 3 4 5 #> 1 0.000000e+00 5.813118e-05 1.654238e-04 3.818149e-05 7.868869e-05 #> 2 5.813118e-05 0.000000e+00 7.576789e-05 2.988167e-05 3.913838e-05 #> 3 1.654238e-04 7.576789e-05 0.000000e+00 4.239359e-05 7.877952e-05 #> 4 3.818149e-05 2.988167e-05 4.239359e-05 0.000000e+00 6.845458e-05 #> 5 7.868869e-05 3.913838e-05 7.877952e-05 6.845458e-05 0.000000e+00"},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":null,"dir":"Reference","previous_headings":"","what":"determine optimal spatial data discretization for individual variables — loess_optnum","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"Function determining optimal spatial data discretization individual variables based locally estimated scatterplot smoothing (LOESS) model.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"","code":"loess_optnum(qvec, discnumvec, increase_rate = 0.05)"},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"qvec numeric vector q statistics. discnumvec numeric vector break numbers corresponding qvec. increase_rate (optional) critical increase rate number discretization. Default 0.05.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"two element numeric vector. discnum optimal number spatial data discretization increase_rate critical increase rate number discretization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"increase_rate satisfied calculation, discrete number corresponding highest q statistic selected return. Note sdsfun sorts discnumvec smallest largest keeps qvec one--one correspondence discnumvec.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"","code":"qv = c(0.26045642,0.64120405,0.43938704,0.95165535,0.46347836, 0.25385338,0.78778726,0.95938330,0.83247885,0.09285196) loess_optnum(qv,3:12) #> discnum increase_rate #> 6.00 0.05"},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":null,"dir":"Reference","previous_headings":"","what":"test global spatial autocorrelation — moran_test","title":"test global spatial autocorrelation — moran_test","text":"Spatial autocorrelation test based global moran index.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"test global spatial autocorrelation — moran_test","text":"","code":"moran_test(sfj, wt = NULL, alternative = \"greater\", symmetrize = FALSE)"},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"test global spatial autocorrelation — moran_test","text":"sfj sf object can converted sf sf::st_as_sf(). wt (optional) Spatial weight matrix. Must matrix class. wt provided, sdsfun use first-order queen adjacency binary matrix. alternative (optional) Specification alternative hypothesis greater (default), lower, two.sided. symmetrize (optional) Whether symmetrize asymmetrical spatial weight matrix wt : 1/2 * (wt + wt'). Default FALSE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"test global spatial autocorrelation — moran_test","text":"list moran_test class result stored result tibble. contains following information variable: MoranI observed value Moran coefficient EI expected value Moran's VarI variance Moran's (normality) ZI standardized Moran coefficient PI p-value test statistic","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"test global spatial autocorrelation — moran_test","text":"C++ implementation MI.vec function spfilteR package, embellishes console output. return result function actually list, please access result tibble using $result. non-numeric columns attribute columns sfj ignored.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"test global spatial autocorrelation — moran_test","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) moran_test(gzma) #> *** global moran test #> ------------------------------------------------------------------- #> Variable MoranI EI VarI zI pI #> ---------- ------------- ----------- ---------- ------- ----------- #> PS_Score 0.504972*** -0.008547 0.003119 9.195 1.877e-20 #> #> EL_Score 0.351095*** -0.008547 0.003119 6.44 5.988e-11 #> #> OH_Score 0.593021*** -0.008547 0.003119 10.77 2.347e-27 #> #> IL_Score 0.483476*** -0.008547 0.003119 8.81 6.257e-19 #> ------------------------------------------------------------------- #>"},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"normalization — normalize_vector","title":"normalization — normalize_vector","text":"normalization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"normalization — normalize_vector","text":"","code":"normalize_vector(x, to_left = 0, to_right = 1)"},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"normalization — normalize_vector","text":"x continuous numeric vector. to_left (optional) Specified minimum. Default 0. to_right (optional) Specified maximum. Default 1.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"normalization — normalize_vector","text":"continuous vector normalized.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"normalization — normalize_vector","text":"","code":"normalize_vector(c(-5,1,5,0.01,0.99)) #> [1] 0.000 0.600 1.000 0.501 0.599"},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"NULL (magrittr pipe operator)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":null,"dir":"Reference","previous_headings":"","what":"remove variable linear trend based on covariate — rm_lineartrend","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"remove variable linear trend based covariate","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"","code":"rm_lineartrend(formula, data, method = c(\"cpp\", \"r\"))"},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"formula formula. data observation data. method (optional) method using, can chosen either cpp r. Default cpp.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"numeric vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) rm_lineartrend(PS_Score ~ ., gzma) #> [1] 0.708424646 -1.609213853 1.389752789 1.693524199 1.327675963 #> [6] 1.552796232 1.899480900 -0.650465423 -0.150480934 1.207015152 #> [11] 1.590458131 -0.300747679 1.143676294 1.457378099 0.606484742 #> [16] 1.080892928 0.290475256 0.851942083 1.067253575 1.682518084 #> [21] 0.137597711 0.806861604 -0.382599378 -1.933709170 0.861349335 #> [26] 0.627829873 -0.395623890 -0.738657687 -0.679936281 1.578903157 #> [31] -1.151803933 2.234107137 0.965888325 0.801133421 1.260946335 #> [36] 0.584697508 1.452096690 1.113403340 0.930704599 0.569299373 #> [41] 0.192976485 0.094368097 0.805529409 1.722632299 1.010261352 #> [46] 1.433806182 0.636670605 0.679991093 0.791008927 0.486903877 #> [51] -0.672956723 1.234880768 1.068841885 -1.611547072 -2.923649428 #> [56] 2.710999016 -2.727100878 -2.465795534 -2.420953865 -1.699626340 #> [61] 0.099917867 -2.620506144 -0.959386254 -2.114950450 -1.701304099 #> [66] -2.710909466 3.000369819 -2.063893641 -1.115021871 -3.280581061 #> [71] -0.109847308 1.353662758 0.008388022 -0.931649680 1.019333454 #> [76] 3.201800582 0.200651409 1.470887804 1.387311480 1.189574771 #> [81] 2.023171387 -1.887476207 1.837215556 0.046758454 -1.084568068 #> [86] -0.932912947 1.072475344 1.192060715 1.757123807 -0.253721067 #> [91] -0.051510901 -0.819077316 0.917087617 1.037676625 0.853722585 #> [96] -2.519645620 -3.249272906 -0.884320640 -3.099347554 -0.903303600 #> [101] -0.477738008 0.133769176 -0.111569828 -2.570393960 0.555851538 #> [106] 0.904301525 -1.008869009 -2.122700858 0.427963148 -2.497669111 #> [111] -2.938632840 0.757894144 -2.047276844 -0.726676936 -3.279405691 #> [116] 0.094510726 -1.269057176 1.971147342 rm_lineartrend(PS_Score ~ ., gzma, method = \"r\") #> [1] 0.708424646 -1.609213853 1.389752789 1.693524199 1.327675963 #> [6] 1.552796232 1.899480900 -0.650465423 -0.150480934 1.207015152 #> [11] 1.590458131 -0.300747679 1.143676294 1.457378099 0.606484742 #> [16] 1.080892928 0.290475256 0.851942083 1.067253575 1.682518084 #> [21] 0.137597711 0.806861604 -0.382599378 -1.933709170 0.861349335 #> [26] 0.627829873 -0.395623890 -0.738657687 -0.679936281 1.578903157 #> [31] -1.151803933 2.234107137 0.965888325 0.801133421 1.260946335 #> [36] 0.584697508 1.452096690 1.113403340 0.930704599 0.569299373 #> [41] 0.192976485 0.094368097 0.805529409 1.722632299 1.010261352 #> [46] 1.433806182 0.636670605 0.679991093 0.791008927 0.486903877 #> [51] -0.672956723 1.234880768 1.068841885 -1.611547072 -2.923649428 #> [56] 2.710999016 -2.727100878 -2.465795534 -2.420953865 -1.699626340 #> [61] 0.099917867 -2.620506144 -0.959386254 -2.114950450 -1.701304099 #> [66] -2.710909466 3.000369819 -2.063893641 -1.115021871 -3.280581061 #> [71] -0.109847308 1.353662758 0.008388022 -0.931649680 1.019333454 #> [76] 3.201800582 0.200651409 1.470887804 1.387311480 1.189574771 #> [81] 2.023171387 -1.887476207 1.837215556 0.046758454 -1.084568068 #> [86] -0.932912947 1.072475344 1.192060715 1.757123807 -0.253721067 #> [91] -0.051510901 -0.819077316 0.917087617 1.037676625 0.853722585 #> [96] -2.519645620 -3.249272906 -0.884320640 -3.099347554 -0.903303600 #> [101] -0.477738008 0.133769176 -0.111569828 -2.570393960 0.555851538 #> [106] 0.904301525 -1.008869009 -2.122700858 0.427963148 -2.497669111 #> [111] -2.938632840 0.757894144 -2.047276844 -0.726676936 -3.279405691 #> [116] 0.094510726 -1.269057176 1.971147342"},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":null,"dir":"Reference","previous_headings":"","what":"extract locations — sf_coordinates","title":"extract locations — sf_coordinates","text":"Extract locations sf objects.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"extract locations — sf_coordinates","text":"","code":"sf_coordinates(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"extract locations — sf_coordinates","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"extract locations — sf_coordinates","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"extract locations — sf_coordinates","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) sf_coordinates(pts) #> X Y #> [1,] 321692.1 4004615 #> [2,] 327093.8 3988283 #> [3,] 319413.4 3999016 #> [4,] 295859.7 4000298 #> [5,] 309115.1 4006437 #> [6,] 307693.8 4001200 #> [7,] 321477.5 3995153 #> [8,] 290924.8 4004432 #> [9,] 310613.7 4008916 #> [10,] 309759.1 3998739 #> [11,] 325896.0 3998749 #> [12,] 298140.7 4012911 #> [13,] 318763.3 3991847 #> [14,] 317858.4 3996996 #> [15,] 293307.1 3997893 #> [16,] 278505.6 4014720 #> [17,] 328858.7 3990305 #> [18,] 321005.4 4001505 #> [19,] 298956.9 4002763 #> [20,] 303136.9 4004695 #> [21,] 303160.4 4000267 #> [22,] 320048.3 3997191 #> [23,] 297232.5 4004157 #> [24,] 314715.6 4004529 #> [25,] 306744.7 3997831 #> [26,] 333088.5 3999333 #> [27,] 274308.9 4010571 #> [28,] 323286.8 3989089 #> [29,] 314776.0 3993128 #> [30,] 295539.1 3995591 #> [31,] 287423.3 4017138 #> [32,] 320535.1 4006257 #> [33,] 305948.2 3991115 #> [34,] 323973.5 4000410 #> [35,] 289667.1 4012704 #> [36,] 306876.0 4004700 #> [37,] 303835.1 4003091 #> [38,] 331003.9 3997742 #> [39,] 296185.7 4007332 #> [40,] 313987.7 4009508 #> [41,] 305798.0 3996370 #> [42,] 301551.3 3992609 #> [43,] 279032.9 4005677 #> [44,] 324950.1 3986925 #> [45,] 312107.6 3998811 #> [46,] 297161.8 3997411 #> [47,] 284636.8 4021080 #> [48,] 308876.5 4009625 #> [49,] 317285.2 3985330 #> [50,] 322264.5 3997923 #> [51,] 291737.8 4011071 #> [52,] 309791.9 4005098 #> [53,] 308641.6 3999711 #> [54,] 327504.6 3997160 #> [55,] 301821.4 4013119 #> [56,] 318552.1 3990024 #> [57,] 307580.2 3995293 #> [58,] 287731.3 4000289 #> [59,] 287216.1 4004408 #> [60,] 319133.0 3986907 #> [61,] 313478.1 4003469 #> [62,] 302109.9 3994967 #> [63,] 299651.2 4015360"},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"generates distance matrix — sf_distance_matrix","title":"generates distance matrix — sf_distance_matrix","text":"Generates distance matrix sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates distance matrix — sf_distance_matrix","text":"","code":"sf_distance_matrix(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates distance matrix — sf_distance_matrix","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates distance matrix — sf_distance_matrix","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates distance matrix — sf_distance_matrix","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) pts_distm = sf_distance_matrix(pts) pts_distm[1:5,1:5] #> 1 2 3 4 5 #> 1 0.000 17202.47 6045.079 26190.70 12708.31 #> 2 17202.473 0.00 13198.202 33465.33 25550.36 #> 3 6045.079 13198.20 0.000 23588.47 12693.66 #> 4 26190.701 33465.33 23588.471 0.00 14608.23 #> 5 12708.306 25550.36 12693.655 14608.23 0.00"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":null,"dir":"Reference","previous_headings":"","what":"sf object geometry column name — sf_geometry_name","title":"sf object geometry column name — sf_geometry_name","text":"Get geometry column name sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sf object geometry column name — sf_geometry_name","text":"","code":"sf_geometry_name(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sf object geometry column name — sf_geometry_name","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sf object geometry column name — sf_geometry_name","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"sf object geometry column name — sf_geometry_name","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_geometry_name(gzma) #> [1] \"geom\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":null,"dir":"Reference","previous_headings":"","what":"sf object geometry type — sf_geometry_type","title":"sf object geometry type — sf_geometry_type","text":"Get geometry type sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sf object geometry type — sf_geometry_type","text":"","code":"sf_geometry_type(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sf object geometry type — sf_geometry_type","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sf object geometry type — sf_geometry_type","text":"lowercase character vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"sf object geometry type — sf_geometry_type","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_geometry_type(gzma) #> [1] \"polygon\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":null,"dir":"Reference","previous_headings":"","what":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"Generates Gauss-Kruger projection epsg coding character corresponding sfj object CGCS2000 spatial reference.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"","code":"sf_gk_proj_cgcs2000(sfj, degree = 6L)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"sfj sf object can converted sf sf::st_as_sf(). degree (optional) 3-degree 6-degree zonal projection, default 6L.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) |> sf::st_transform(4490) sf_gk_proj_cgcs2000(gzma,3) #> [1] \"EPSG:4547\" sf_gk_proj_cgcs2000(gzma,6) #> [1] \"EPSG:4508\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":null,"dir":"Reference","previous_headings":"","what":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"Generates utm projection epsg coding character corresponding sfj object WGS84 spatial reference.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"","code":"sf_utm_proj_wgs84(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_utm_proj_wgs84(gzma) #> [1] \"EPSG:32649\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":null,"dir":"Reference","previous_headings":"","what":"generates voronoi diagram — sf_voronoi_diagram","title":"generates voronoi diagram — sf_voronoi_diagram","text":"Generates Voronoi diagram (Thiessen polygons) sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates voronoi diagram — sf_voronoi_diagram","text":"","code":"sf_voronoi_diagram(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sf object polygon geometry type can converted sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sf objects (multi-)point type supported generate voronoi diagram returned result includes geometry column.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates voronoi diagram — sf_voronoi_diagram","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) pts_v = sf_voronoi_diagram(pts) library(ggplot2) ggplot() + geom_sf(data = pts_v, color = 'red', fill = 'transparent') + geom_sf(data = pts, color = 'blue', size = 1.25) + theme_void()"},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":null,"dir":"Reference","previous_headings":"","what":"only spade power of spatial determinant — spade_psd","title":"only spade power of spatial determinant — spade_psd","text":"spade power spatial determinant","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"only spade power of spatial determinant — spade_psd","text":"","code":"spade_psd(y, hs, wt)"},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"only spade power of spatial determinant — spade_psd","text":"y Dependent variable hs Independent variable wt Spatial weight matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"only spade power of spatial determinant — spade_psd","text":"numeric value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"only spade power of spatial determinant — spade_psd","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = inverse_distance_swm(gzma) spade_psd(y = gzma$PS_Score, hs = discretize_vector(gzma$PS_Score,5), wt = wt1) #> [1] 0.9480239"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"Constructs spatial weight matrices based contiguity via spdep package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"","code":"spdep_contiguity_swm( sfj, queen = TRUE, k = NULL, order = 1L, cumulate = TRUE, style = \"W\", zero.policy = TRUE )"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"sfj sf object can converted sf sf::st_as_sf(). queen (optional) TRUE, using queen contiguity, otherwise rook contiguity. Default TRUE. k (optional) number nearest neighbours. Ignore parameter using distance based neighbours construct spatial weight matrices. order (optional) order adjacency object. Default 1. cumulate (optional) Whether accumulate adjacency objects. Default TRUE. style (optional) style can take values W, B, C, S. see spdep::nb2mat(). Default W. zero.policy (optional) FALSE stop error empty neighbour sets, TRUE permit weights list formed zero-length weights vectors. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"k set positive value, using K-Nearest Neighbor Weights.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = spdep_contiguity_swm(gzma, k = 6, style = 'B') wt2 = spdep_contiguity_swm(gzma, queen = TRUE, style = 'B') wt3 = spdep_contiguity_swm(gzma, queen = FALSE, order = 2, style = 'B')"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"constructs spatial weight matrices based on distance — spdep_distance_swm","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"Constructs spatial weight matrices based distance via spdep package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"","code":"spdep_distance_swm( sfj, kernel = NULL, k = NULL, bandwidth = NULL, power = 1, style = \"W\", zero.policy = TRUE )"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"sfj sf object can converted sf sf::st_as_sf(). kernel (optional) kernel function, can one uniform, triangular,quadratic(epanechnikov),quartic gaussian. Default NULL. k (optional) number nearest neighbours. Default NULL. useful kernel provided. bandwidth (optional) bandwidth, default NULL. spatial reference sf object geographical coordinate system, unit bandwidth km. unit used projection coordinate system consistent used sf object coordinate system. power (optional) Default 1. Useful kernel provided. style (optional) style can take values W, B, C, S. see spdep::nb2mat(). Default W. spatial weights based distance functions, style B means using original value calculated distance function. zero.policy (optional) FALSE stop error empty neighbour sets, TRUE permit weights list formed zero-length weights vectors. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"five different kernel weight functions: uniform: \\(K_{(z)} = 1/2\\),\\(\\lvert z \\rvert < 1\\) triangular \\(K_{(z)} = 1 - \\lvert z \\rvert\\),\\(\\lvert z \\rvert < 1\\) quadratic (epanechnikov) \\(K_{(z)} = \\frac{3}{4} \\left( 1 - z^2 \\right)\\),\\(\\lvert z \\rvert < 1\\) quartic \\(K_{(z)} = \\frac{15}{16} {\\left( 1 - z^2 \\right)}^2\\),\\(\\lvert z \\rvert < 1\\) gaussian \\(K_{(z)} = \\frac{1}{\\sqrt{2 \\pi}} e^{- \\frac{z^2}{2}}\\) equation , \\(z = d_{ij} / h_i\\) \\(h_i\\) bandwidth","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"kernel setting, using distance weight based kernel function, Otherwise inverse distance weight used.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) wt1 = spdep_distance_swm(pts, style = 'B') wt2 = spdep_distance_swm(pts, kernel = 'gaussian') wt3 = spdep_distance_swm(pts, k = 3, kernel = 'gaussian') wt4 = spdep_distance_swm(pts, k = 3, kernel = 'gaussian', bandwidth = 10000)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial linear models selection — spdep_lmtest","title":"spatial linear models selection — spdep_lmtest","text":"spatial linear models selection","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial linear models selection — spdep_lmtest","text":"","code":"spdep_lmtest(formula, data, listw = NULL)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial linear models selection — spdep_lmtest","text":"formula formula linear regression model. data sf object observation data. listw (optional) listw. See spdep::mat2listw() spdep::nb2listw() details.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial linear models selection — spdep_lmtest","text":"list","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial linear models selection — spdep_lmtest","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) spdep_lmtest(PS_Score ~ ., gzma) #> \tRao's score (a.k.a Lagrange multiplier) diagnostics for spatial #> \tdependence #> data: #> model: stats::lm(formula = formula, data = data) #> test weights: listw #> #> statistic parameter p.value #> RSerr 66.8965 1 3.331e-16 *** #> RSlag 59.1366 1 1.465e-14 *** #> adjRSerr 8.2199 1 0.004143 ** #> adjRSlag 0.4600 1 0.497622 #> SARMA 67.3565 2 2.331e-15 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":null,"dir":"Reference","previous_headings":"","what":"construct neighbours list — spdep_nb","title":"construct neighbours list — spdep_nb","text":"construct neighbours list","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"construct neighbours list — spdep_nb","text":"","code":"spdep_nb(sfj, queen = TRUE, k = NULL, order = 1L, cumulate = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"construct neighbours list — spdep_nb","text":"sfj sf object can converted sf sf::st_as_sf(). queen (optional) TRUE, using queen contiguity, otherwise rook contiguity. Default TRUE. k (optional) number nearest neighbours. Ignore parameter using distance based neighbours. order (optional) order adjacency object. Default 1. cumulate (optional) Whether accumulate adjacency objects. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"construct neighbours list — spdep_nb","text":"neighbours list class nb","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"construct neighbours list — spdep_nb","text":"k set positive value, using K-Nearest Neighbor","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"construct neighbours list — spdep_nb","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) nb1 = spdep_nb(pts, k = 6) nb2 = spdep_nb(pts, queen = TRUE) nb3 = spdep_nb(pts, queen = FALSE, order = 2)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial c(k)luster analysis by tree edge removal — spdep_skater","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"SKATER forms clusters spatially partitioning data similar values features interest.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"","code":"spdep_skater(sfj, k = 6, nb = NULL, ini = 5, ...)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"sfj sf object observation data. Please ensure attribute columns included SKATER analysis. k (optional) number clusters. Default 6. nb (optional) neighbours list class nb. input nb NULL, constructed automatically using spdep_nb(). ini (optional) initial node minimal spanning tree. Defaul 5. ... (optional) parameters passed spdep::skater().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"numeric vector clusters.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) gzma_c = spdep_skater(gzma,8) gzma$group = gzma_c plot(gzma[\"group\"])"},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial variance — spvar","title":"spatial variance — spvar","text":"spatial variance","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial variance — spvar","text":"","code":"spvar(x, wt, method = c(\"cpp\", \"r\"))"},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial variance — spvar","text":"x numerical vector . wt spatial weight matrix. method (optional) method calculating spatial variance, can chosen either cpp r. Default cpp.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial variance — spvar","text":"numerical value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"spatial variance — spvar","text":"spatial variance formula \\(\\Gamma = \\frac{\\sum_i \\sum_{j \\neq } \\omega_{ij}\\frac{(y_i-y_j)^2}{2}}{\\sum_i \\sum_{j \\neq } \\omega_{ij}}\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial variance — spvar","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = inverse_distance_swm(gzma) spvar(gzma$PS_Score,wt1) #> [1] 2.406486"},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":null,"dir":"Reference","previous_headings":"","what":"test explanatory power of spatial stratified heterogeneity — ssh_test","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"Spatial stratified heterogeneity test based geographical detector q value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"","code":"ssh_test(y, hs)"},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"y Variable Y, continuous numeric vector. hs Spatial stratification classification explanatory variable. factor, character, integer data.frame, tibble sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"C++ implementation factor_detector function gdverse package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"","code":"ssh_test(y = 1:7, hs = c('x',rep('y',3),rep('z',3))) #> # A tibble: 1 × 2 #> Qvalue Pvalue #> #> 1 0.857 0.0528"},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"standardization — standardize_vector","title":"standardization — standardize_vector","text":"calculate Z-score using variance normalization, formula follows: \\(Z = \\frac{(x - mean(x))}{sd(x)}\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"standardization — standardize_vector","text":"","code":"standardize_vector(x)"},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"standardization — standardize_vector","text":"x numeric vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"standardization — standardize_vector","text":"standardized numeric vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"standardization — standardize_vector","text":"","code":"standardize_vector(1:10) #> [1] -1.4863011 -1.1560120 -0.8257228 -0.4954337 -0.1651446 0.1651446 #> [7] 0.4954337 0.8257228 1.1560120 1.4863011"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":null,"dir":"Reference","previous_headings":"","what":"convert discrete variables in a tibble to integers — tbl_all2int","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"convert discrete variables tibble integers","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"","code":"tbl_all2int(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"tbl tibble,data.frame sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"converted tibble,data.frame sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"","code":"demotbl = tibble::tibble(x = c(1,2,3,3,1), y = letters[1:5], z = c(1L,1L,2L,2L,3L), m = factor(letters[1:5],levels = letters[5:1])) tbl_all2int(demotbl) #> # A tibble: 5 × 4 #> x y z m #> #> 1 1 1 1 5 #> 2 2 2 1 4 #> 3 3 3 2 3 #> 4 3 4 2 2 #> 5 1 5 3 1"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":null,"dir":"Reference","previous_headings":"","what":"convert xyz tbl to matrix — tbl_xyz2mat","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"convert xyz tbl matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"","code":"tbl_xyz2mat(tbl, x = 1, y = 2, z = 3)"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"tbl tibble,data.frame sf object. x (optional) x-axis coordinates column number, default 1. y (optional) y-axis coordinates column number, default 2. z (optional) z (attribute) coordinates column number, default 3.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"list. z_attrs_matrix matrix attribute information. x_coords_matrix matrix x-axis coordinates. y_coords_matrix matrix y-axis coordinates.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"","code":"set.seed(42) lon = rep(1:3,each = 3) lat = rep(1:3,times = 3) zattr = rnorm(9, mean = 10, sd = 1) demodf = data.frame(x = lon, y = lat, z = zattr) demodf #> x y z #> 1 1 1 11.370958 #> 2 1 2 9.435302 #> 3 1 3 10.363128 #> 4 2 1 10.632863 #> 5 2 2 10.404268 #> 6 2 3 9.893875 #> 7 3 1 11.511522 #> 8 3 2 9.905341 #> 9 3 3 12.018424 tbl_xyz2mat(demodf) #> $z_attrs_matrix #> [,1] [,2] [,3] #> [1,] 10.363128 9.893875 12.018424 #> [2,] 9.435302 10.404268 9.905341 #> [3,] 11.370958 10.632863 11.511522 #> #> $x_coords_matrix #> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 1 2 3 #> [3,] 1 2 3 #> #> $y_coords_matrix #> [,1] [,2] [,3] #> [1,] 3 3 3 #> [2,] 2 2 2 #> [3,] 1 1 1 #>"},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-070","dir":"Changelog","previous_headings":"","what":"sdsfun 0.7.0","title":"sdsfun 0.7.0","text":"Handling NA Values Specifically rm_lineartrend() (#29).","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-060","dir":"Changelog","previous_headings":"","what":"sdsfun 0.6.0","title":"sdsfun 0.6.0","text":"CRAN release: 2024-12-11 Add support removing variable linear trend based covariate (#23). Adds support converting long-form tables matrices corresponding two-dimensional spatial positions (#20). aggregation method hierarchical clustering hclustgeo_disc() set ward.D2 default (#18).","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-050","dir":"Changelog","previous_headings":"","what":"sdsfun 0.5.0","title":"sdsfun 0.5.0","text":"CRAN release: 2024-11-25 Add hclustgeo_disc hierarchical clustering spatial soft constraints (#13). Add spade_psd fast estimation SPADE model psd-value. Add sf_gk_proj_cgcs2000() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-043","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.3","title":"sdsfun 0.4.3","text":"CRAN release: 2024-11-15 Add geodetector_q fast estimation geodetector q-value.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-042","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.2","title":"sdsfun 0.4.2","text":"CRAN release: 2024-11-11 Add check_tbl_na tbl_all2int functions better support gdverse sesp packages.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-041","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.1","title":"sdsfun 0.4.1","text":"CRAN release: 2024-10-16 Fix bug causes R crash input x factor character discretize_vector function (#12). Implement formula_varname function return corresponding variable names formula data.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-040","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.0","title":"sdsfun 0.4.0","text":"CRAN release: 2024-10-08 Improve handling n-level categorical variables generating n-1 dummy variables (#2). Add spdep_lmtest function spatial linear model selection (#3). Migrate moran_test function geocomplexity package sdsfun (#4). Implement geographical detector’s factor detector ssh_test using Rcpp enhance performance (#5). Introduce discretize_vector function support variable discretization (#6). Apply loess_optnum function select optimal number discretization intervals (#10). Implement spatial variance calculation spvar function, support R C++ implementations (#11). Rename dummy_vector dummy_vec consistency naming conventions. Add sf_coordinates function extract coordinates sf objects.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-030","dir":"Changelog","previous_headings":"","what":"sdsfun 0.3.0","title":"sdsfun 0.3.0","text":"CRAN release: 2024-09-30 Begin use Rcpp complete tasks high computational complexity. Add dummy_vector dummy_tbl functions dummy variables generation. Add spdep_nb function neighbours list generation. Add spdep_skater function spatial constrained clustering. Add fuzzyoverlay function spatial fuzzy overlay. Update package extdata; now sdsfun two extdata: gzma.gpkg pts.gpkg.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-021","dir":"Changelog","previous_headings":"","what":"sdsfun 0.2.1","title":"sdsfun 0.2.1","text":"CRAN release: 2024-09-23 Enhance support types spatial vector data. Inhibit warning information produced spdep. Add sf_utm_proj_wgs84() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-020","dir":"Changelog","previous_headings":"","what":"sdsfun 0.2.0","title":"sdsfun 0.2.0","text":"CRAN release: 2024-09-15 Add sf_distance_matrix() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-011","dir":"Changelog","previous_headings":"","what":"sdsfun 0.1.1","title":"sdsfun 0.1.1","text":"CRAN release: 2024-09-08 Update function documentation spdep_contiguity_swm() spdep_distance_swm(). Move source code SpatLyu/sdsfun GitHub stscl/sdsfun.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-010","dir":"Changelog","previous_headings":"","what":"sdsfun 0.1.0","title":"sdsfun 0.1.0","text":"CRAN release: 2024-08-30 Initial CRAN submission.","code":""}] +[{"path":"https://stscl.github.io/sdsfun/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Wenbo Lv. Author, maintainer, copyright holder.","code":""},{"path":"https://stscl.github.io/sdsfun/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Lv W (2025). sdsfun: Spatial Data Science Complementary Features. R package version 0.7.0, https://github.com/stscl/sdsfun, https://stscl.github.io/sdsfun/.","code":"@Manual{, title = {sdsfun: Spatial Data Science Complementary Features}, author = {Wenbo Lv}, year = {2025}, note = {R package version 0.7.0, https://github.com/stscl/sdsfun}, url = {https://stscl.github.io/sdsfun/}, }"},{"path":"https://stscl.github.io/sdsfun/index.html","id":"sdsfun-","dir":"","previous_headings":"","what":"sdsfun | Spatial Data Science Complementary Features\n","title":"sdsfun | Spatial Data Science Complementary Features\n","text":"Spatial Data Science Complementary Features","code":""},{"path":"https://stscl.github.io/sdsfun/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"sdsfun | Spatial Data Science Complementary Features\n","text":"Install CRAN : Install development binary version R-universe : Install development source version GitHub :","code":"install.packages(\"sdsfun\") install.packages('sdsfun', repos = c(\"https://stscl.r-universe.dev\", \"https://cloud.r-project.org\"), dep = TRUE) # install.packages(\"devtools\") devtools::install_github(\"stscl/sdsfun\", dep = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":null,"dir":"Reference","previous_headings":"","what":"check for NA values in a tibble — check_tbl_na","title":"check for NA values in a tibble — check_tbl_na","text":"check NA values tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"check for NA values in a tibble — check_tbl_na","text":"","code":"check_tbl_na(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"check for NA values in a tibble — check_tbl_na","text":"tbl tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"check for NA values in a tibble — check_tbl_na","text":"logical value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/check_tbl_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"check for NA values in a tibble — check_tbl_na","text":"","code":"demotbl = tibble::tibble(x = c(1,2,3,NA,1), y = c(NA,NA,1:3), z = 1:5) demotbl #> # A tibble: 5 × 3 #> x y z #> #> 1 1 NA 1 #> 2 2 NA 2 #> 3 3 1 3 #> 4 NA 2 4 #> 5 1 3 5 check_tbl_na(demotbl) #> [1] TRUE"},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"discretization — discretize_vector","title":"discretization — discretize_vector","text":"discretization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"discretization — discretize_vector","text":"","code":"discretize_vector( x, n, method = \"natural\", breakpoint = NULL, sampleprob = 0.15, seed = 123456789 )"},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"discretization — discretize_vector","text":"x continuous numeric vector. n (optional) number discretized classes. method (optional) method discretization, default natural. breakpoint (optional) Break points manually splitting data. method manual, breakpoint required. sampleprob (optional) data size exceeds 3000, perform sampling discretization, applicable natural breaks. Default 0.15. seed (optional) Random seed number, default 123456789.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"discretization — discretize_vector","text":"discretized integer vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/discretize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"discretization — discretize_vector","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) discretize_vector(xvar, n = 5, method = 'natural') #> [1] 5 4 2 3 4 2 4 2 1 1 5 3 3 3 2 1 5 1 1 1 1 1 3 3 3 2 5 1 2 4 3 2"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":null,"dir":"Reference","previous_headings":"","what":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"transforming category tibble corresponding dummy variable tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"","code":"dummy_tbl(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"tbl tibble data.frame.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_tbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"transforming a category tibble into the corresponding dummy variable tibble — dummy_tbl","text":"","code":"a = tibble::tibble(x = 1:3,y = 4:6) dummy_tbl(a) #> # A tibble: 3 × 4 #> x_1 x_2 y_1 y_2 #> #> 1 1 0 1 0 #> 2 0 1 0 1 #> 3 0 0 0 0"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":null,"dir":"Reference","previous_headings":"","what":"transforming a categorical variable into dummy variables — dummy_vec","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"transforming categorical variable dummy variables","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"","code":"dummy_vec(x)"},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"x integer vector can converted integer vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/dummy_vec.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"transforming a categorical variable into dummy variables — dummy_vec","text":"","code":"dummy_vec(c(1,1,3,2,4,6)) #> [,1] [,2] [,3] [,4] #> [1,] 1 0 0 0 #> [2,] 1 0 0 0 #> [3,] 0 1 0 0 #> [4,] 0 0 1 0 #> [5,] 0 0 0 1 #> [6,] 0 0 0 0"},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":null,"dir":"Reference","previous_headings":"","what":"get variable names in a formula and data — formula_varname","title":"get variable names in a formula and data — formula_varname","text":"get variable names formula data","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"get variable names in a formula and data — formula_varname","text":"","code":"formula_varname(formula, data)"},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"get variable names in a formula and data — formula_varname","text":"formula formula. data data.frame, tibble sf object observation data.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"get variable names in a formula and data — formula_varname","text":"list. yname Independent variable name xname Dependent variable names","code":""},{"path":"https://stscl.github.io/sdsfun/reference/formula_varname.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"get variable names in a formula and data — formula_varname","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) formula_varname(PS_Score ~ EL_Score + OH_Score, gzma) #> $yname #> [1] \"PS_Score\" #> #> $xname #> [1] \"EL_Score\" \"OH_Score\" #> formula_varname(PS_Score ~ ., gzma) #> $yname #> [1] \"PS_Score\" #> #> $xname #> [1] \"EL_Score\" \"OH_Score\" \"IL_Score\" #>"},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial fuzzy overlay — fuzzyoverlay","title":"spatial fuzzy overlay — fuzzyoverlay","text":"spatial fuzzy overlay","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial fuzzy overlay — fuzzyoverlay","text":"","code":"fuzzyoverlay(formula, data, method = \"and\")"},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial fuzzy overlay — fuzzyoverlay","text":"formula formula spatial fuzzy overlay. data data.frame tibble discretized data. method (optional) Overlay methods. method , use min fuzzy overlay; method ,use max fuzzy overlay. Default .","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial fuzzy overlay — fuzzyoverlay","text":"numeric vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"spatial fuzzy overlay — fuzzyoverlay","text":"Independent variables data provided fuzzyoverlay() must discretized variables, dependent variable continuous variable.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/fuzzyoverlay.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial fuzzy overlay — fuzzyoverlay","text":"","code":"set.seed(42) sim = tibble::tibble(y = stats::runif(7,0,10), x1 = c(1,rep(2,3),rep(3,3)), x2 = c(rep(1,2),rep(2,2),rep(3,3))) fo1 = fuzzyoverlay(y~x1+x2,data = sim, method = 'and') fo1 #> 1 2 3 4 5 6 7 #> \"x1_1\" \"x1_2\" \"x2_2\" \"x2_2\" \"x1_3\" \"x1_3\" \"x1_3\" fo2 = fuzzyoverlay(y~x1+x2,data = sim, method = 'or') fo2 #> 1 2 3 4 5 6 7 #> \"x2_1\" \"x2_1\" \"x1_2\" \"x1_2\" \"x1_3\" \"x1_3\" \"x1_3\""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":null,"dir":"Reference","previous_headings":"","what":"generate subsets of a set — generate_subsets","title":"generate subsets of a set — generate_subsets","text":"generate subsets set","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generate subsets of a set — generate_subsets","text":"","code":"generate_subsets(set, empty = TRUE, self = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generate subsets of a set — generate_subsets","text":"set vector. empty (optional) empty TRUE, generated subset includes empty set, otherwise empty set removed. Default TRUE. self (optional) self TRUE, resulting subset includes set , otherwise set removed. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generate subsets of a set — generate_subsets","text":"list.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/generate_subsets.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generate subsets of a set — generate_subsets","text":"","code":"generate_subsets(letters[1:3]) #> [[1]] #> NULL #> #> [[2]] #> [1] \"a\" #> #> [[3]] #> [1] \"b\" #> #> [[4]] #> [1] \"c\" #> #> [[5]] #> [1] \"a\" \"b\" #> #> [[6]] #> [1] \"a\" \"c\" #> #> [[7]] #> [1] \"b\" \"c\" #> #> [[8]] #> [1] \"a\" \"b\" \"c\" #> generate_subsets(letters[1:3],empty = FALSE) #> [[1]] #> [1] \"a\" #> #> [[2]] #> [1] \"b\" #> #> [[3]] #> [1] \"c\" #> #> [[4]] #> [1] \"a\" \"b\" #> #> [[5]] #> [1] \"a\" \"c\" #> #> [[6]] #> [1] \"b\" \"c\" #> #> [[7]] #> [1] \"a\" \"b\" \"c\" #> generate_subsets(letters[1:3],self = FALSE) #> [[1]] #> NULL #> #> [[2]] #> [1] \"a\" #> #> [[3]] #> [1] \"b\" #> #> [[4]] #> [1] \"c\" #> #> [[5]] #> [1] \"a\" \"b\" #> #> [[6]] #> [1] \"a\" \"c\" #> #> [[7]] #> [1] \"b\" \"c\" #> generate_subsets(letters[1:3],empty = FALSE,self = FALSE) #> [[1]] #> [1] \"a\" #> #> [[2]] #> [1] \"b\" #> #> [[3]] #> [1] \"c\" #> #> [[4]] #> [1] \"a\" \"b\" #> #> [[5]] #> [1] \"a\" \"c\" #> #> [[6]] #> [1] \"b\" \"c\" #>"},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":null,"dir":"Reference","previous_headings":"","what":"only geodetector q-value — geodetector_q","title":"only geodetector q-value — geodetector_q","text":"geodetector q-value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"only geodetector q-value — geodetector_q","text":"","code":"geodetector_q(y, hs)"},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"only geodetector q-value — geodetector_q","text":"y Dependent variable hs Independent variable","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"only geodetector q-value — geodetector_q","text":"numeric value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/geodetector_q.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"only geodetector q-value — geodetector_q","text":"","code":"geodetector_q(y = 1:7, hs = c('x',rep('y',3),rep('z',3))) #> [1] 0.8571429"},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":null,"dir":"Reference","previous_headings":"","what":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"hierarchical clustering spatial soft constraints","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"","code":"hclustgeo_disc( data, n, alpha = 0.5, D1 = NULL, hclustm = \"ward.D2\", scale = TRUE, wt = NULL, ... )"},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"data sf object, tibble, data.frame, matrix vector observations data. n number hierarchical clustering classes, can numeric value vector. alpha (optional) positive value 0 1. mixing parameter gives relative importance \"feature\" space \"constraint\" space. Default 0.5. D1 (optional) matrix dissimilarities observations data. data sf object alpha 0, D1 generated sdsfun::sf_distance_matrix(), others use matrix elements equal 0. hclustm (optional) agglomeration method used, default ward.D2. details, please see stats::hclust(). scale (optional) Whether scaled dissimilarities matrix, default TRUE. wt (optional) Vector weights observations. default, wt NULL. ... (optional) arguments passed stats::dist().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"grouped membership: vector n scalar, matrix (columns correspond elements n) .","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"C++ enhanced implementation hclustgeo function ClustGeo package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/hclustgeo_disc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"hierarchical clustering with spatial soft constraints — hclustgeo_disc","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) gzma$group = hclustgeo_disc(gzma,5,alpha = 0.75) plot(gzma[\"group\"])"},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"construct inverse distance weight — inverse_distance_swm","title":"construct inverse distance weight — inverse_distance_swm","text":"Function constructing inverse distance weight.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"construct inverse distance weight — inverse_distance_swm","text":"","code":"inverse_distance_swm(sfj, power = 1, bandwidth = NULL)"},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"construct inverse distance weight — inverse_distance_swm","text":"sfj Vector object can converted sf sf::st_as_sf(). power (optional) Default 1. Set 2 gravity weights. bandwidth (optional) distance bigger bandwidth, corresponding part weight matrix set 0. Default NULL, means use bandwidth.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"construct inverse distance weight — inverse_distance_swm","text":"inverse distance weight matrices class matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"construct inverse distance weight — inverse_distance_swm","text":"inverse distance weight formula \\(w_{ij} = 1 / d_{ij}^\\alpha\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/inverse_distance_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"construct inverse distance weight — inverse_distance_swm","text":"","code":"library(sf) #> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE pts = read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) wt = inverse_distance_swm(pts) wt[1:5,1:5] #> 1 2 3 4 5 #> 1 0.000000e+00 5.813118e-05 1.654238e-04 3.818149e-05 7.868869e-05 #> 2 5.813118e-05 0.000000e+00 7.576789e-05 2.988167e-05 3.913838e-05 #> 3 1.654238e-04 7.576789e-05 0.000000e+00 4.239359e-05 7.877952e-05 #> 4 3.818149e-05 2.988167e-05 4.239359e-05 0.000000e+00 6.845458e-05 #> 5 7.868869e-05 3.913838e-05 7.877952e-05 6.845458e-05 0.000000e+00"},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":null,"dir":"Reference","previous_headings":"","what":"determine optimal spatial data discretization for individual variables — loess_optnum","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"Function determining optimal spatial data discretization individual variables based locally estimated scatterplot smoothing (LOESS) model.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"","code":"loess_optnum(qvec, discnumvec, increase_rate = 0.05)"},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"qvec numeric vector q statistics. discnumvec numeric vector break numbers corresponding qvec. increase_rate (optional) critical increase rate number discretization. Default 0.05.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"two element numeric vector. discnum optimal number spatial data discretization increase_rate critical increase rate number discretization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"increase_rate satisfied calculation, discrete number corresponding highest q statistic selected return. Note sdsfun sorts discnumvec smallest largest keeps qvec one--one correspondence discnumvec.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/loess_optnum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"determine optimal spatial data discretization for individual variables — loess_optnum","text":"","code":"qv = c(0.26045642,0.64120405,0.43938704,0.95165535,0.46347836, 0.25385338,0.78778726,0.95938330,0.83247885,0.09285196) loess_optnum(qv,3:12) #> discnum increase_rate #> 6.00 0.05"},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":null,"dir":"Reference","previous_headings":"","what":"test global spatial autocorrelation — moran_test","title":"test global spatial autocorrelation — moran_test","text":"Spatial autocorrelation test based global moran index.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"test global spatial autocorrelation — moran_test","text":"","code":"moran_test(sfj, wt = NULL, alternative = \"greater\", symmetrize = FALSE)"},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"test global spatial autocorrelation — moran_test","text":"sfj sf object can converted sf sf::st_as_sf(). wt (optional) Spatial weight matrix. Must matrix class. wt provided, sdsfun use first-order queen adjacency binary matrix. alternative (optional) Specification alternative hypothesis greater (default), lower, two.sided. symmetrize (optional) Whether symmetrize asymmetrical spatial weight matrix wt : 1/2 * (wt + wt'). Default FALSE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"test global spatial autocorrelation — moran_test","text":"list moran_test class result stored result tibble. contains following information variable: MoranI observed value Moran coefficient EI expected value Moran's VarI variance Moran's (normality) ZI standardized Moran coefficient PI p-value test statistic","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"test global spatial autocorrelation — moran_test","text":"C++ implementation MI.vec function spfilteR package, embellishes console output. return result function actually list, please access result tibble using $result. non-numeric columns attribute columns sfj ignored.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/moran_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"test global spatial autocorrelation — moran_test","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) moran_test(gzma) #> *** global moran test #> ------------------------------------------------------------------- #> Variable MoranI EI VarI zI pI #> ---------- ------------- ----------- ---------- ------- ----------- #> PS_Score 0.504972*** -0.008547 0.003119 9.195 1.877e-20 #> #> EL_Score 0.351095*** -0.008547 0.003119 6.44 5.988e-11 #> #> OH_Score 0.593021*** -0.008547 0.003119 10.77 2.347e-27 #> #> IL_Score 0.483476*** -0.008547 0.003119 8.81 6.257e-19 #> ------------------------------------------------------------------- #>"},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"normalization — normalize_vector","title":"normalization — normalize_vector","text":"normalization","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"normalization — normalize_vector","text":"","code":"normalize_vector(x, to_left = 0, to_right = 1)"},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"normalization — normalize_vector","text":"x continuous numeric vector. to_left (optional) Specified minimum. Default 0. to_right (optional) Specified maximum. Default 1.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"normalization — normalize_vector","text":"continuous vector normalized.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/normalize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"normalization — normalize_vector","text":"","code":"normalize_vector(c(-5,1,5,0.01,0.99)) #> [1] 0.000 0.600 1.000 0.501 0.599"},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":null,"dir":"Reference","previous_headings":"","what":"Pipe operator — %>%","title":"Pipe operator — %>%","text":"See magrittr::%>% details.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pipe operator — %>%","text":"","code":"lhs %>% rhs"},{"path":"https://stscl.github.io/sdsfun/reference/pipe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pipe operator — %>%","text":"NULL (magrittr pipe operator)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":null,"dir":"Reference","previous_headings":"","what":"remove variable linear trend based on covariate — rm_lineartrend","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"remove variable linear trend based covariate","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"","code":"rm_lineartrend(formula, data, method = c(\"cpp\", \"r\"))"},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"formula formula. data observation data. method (optional) method using, can chosen either cpp r. Default cpp.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"numeric vector.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/rm_lineartrend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"remove variable linear trend based on covariate — rm_lineartrend","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) rm_lineartrend(PS_Score ~ ., gzma) #> [1] 0.708424646 -1.609213853 1.389752789 1.693524199 1.327675963 #> [6] 1.552796232 1.899480900 -0.650465423 -0.150480934 1.207015152 #> [11] 1.590458131 -0.300747679 1.143676294 1.457378099 0.606484742 #> [16] 1.080892928 0.290475256 0.851942083 1.067253575 1.682518084 #> [21] 0.137597711 0.806861604 -0.382599378 -1.933709170 0.861349335 #> [26] 0.627829873 -0.395623890 -0.738657687 -0.679936281 1.578903157 #> [31] -1.151803933 2.234107137 0.965888325 0.801133421 1.260946335 #> [36] 0.584697508 1.452096690 1.113403340 0.930704599 0.569299373 #> [41] 0.192976485 0.094368097 0.805529409 1.722632299 1.010261352 #> [46] 1.433806182 0.636670605 0.679991093 0.791008927 0.486903877 #> [51] -0.672956723 1.234880768 1.068841885 -1.611547072 -2.923649428 #> [56] 2.710999016 -2.727100878 -2.465795534 -2.420953865 -1.699626340 #> [61] 0.099917867 -2.620506144 -0.959386254 -2.114950450 -1.701304099 #> [66] -2.710909466 3.000369819 -2.063893641 -1.115021871 -3.280581061 #> [71] -0.109847308 1.353662758 0.008388022 -0.931649680 1.019333454 #> [76] 3.201800582 0.200651409 1.470887804 1.387311480 1.189574771 #> [81] 2.023171387 -1.887476207 1.837215556 0.046758454 -1.084568068 #> [86] -0.932912947 1.072475344 1.192060715 1.757123807 -0.253721067 #> [91] -0.051510901 -0.819077316 0.917087617 1.037676625 0.853722585 #> [96] -2.519645620 -3.249272906 -0.884320640 -3.099347554 -0.903303600 #> [101] -0.477738008 0.133769176 -0.111569828 -2.570393960 0.555851538 #> [106] 0.904301525 -1.008869009 -2.122700858 0.427963148 -2.497669111 #> [111] -2.938632840 0.757894144 -2.047276844 -0.726676936 -3.279405691 #> [116] 0.094510726 -1.269057176 1.971147342 rm_lineartrend(PS_Score ~ ., gzma, method = \"r\") #> [1] 0.708424646 -1.609213853 1.389752789 1.693524199 1.327675963 #> [6] 1.552796232 1.899480900 -0.650465423 -0.150480934 1.207015152 #> [11] 1.590458131 -0.300747679 1.143676294 1.457378099 0.606484742 #> [16] 1.080892928 0.290475256 0.851942083 1.067253575 1.682518084 #> [21] 0.137597711 0.806861604 -0.382599378 -1.933709170 0.861349335 #> [26] 0.627829873 -0.395623890 -0.738657687 -0.679936281 1.578903157 #> [31] -1.151803933 2.234107137 0.965888325 0.801133421 1.260946335 #> [36] 0.584697508 1.452096690 1.113403340 0.930704599 0.569299373 #> [41] 0.192976485 0.094368097 0.805529409 1.722632299 1.010261352 #> [46] 1.433806182 0.636670605 0.679991093 0.791008927 0.486903877 #> [51] -0.672956723 1.234880768 1.068841885 -1.611547072 -2.923649428 #> [56] 2.710999016 -2.727100878 -2.465795534 -2.420953865 -1.699626340 #> [61] 0.099917867 -2.620506144 -0.959386254 -2.114950450 -1.701304099 #> [66] -2.710909466 3.000369819 -2.063893641 -1.115021871 -3.280581061 #> [71] -0.109847308 1.353662758 0.008388022 -0.931649680 1.019333454 #> [76] 3.201800582 0.200651409 1.470887804 1.387311480 1.189574771 #> [81] 2.023171387 -1.887476207 1.837215556 0.046758454 -1.084568068 #> [86] -0.932912947 1.072475344 1.192060715 1.757123807 -0.253721067 #> [91] -0.051510901 -0.819077316 0.917087617 1.037676625 0.853722585 #> [96] -2.519645620 -3.249272906 -0.884320640 -3.099347554 -0.903303600 #> [101] -0.477738008 0.133769176 -0.111569828 -2.570393960 0.555851538 #> [106] 0.904301525 -1.008869009 -2.122700858 0.427963148 -2.497669111 #> [111] -2.938632840 0.757894144 -2.047276844 -0.726676936 -3.279405691 #> [116] 0.094510726 -1.269057176 1.971147342"},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":null,"dir":"Reference","previous_headings":"","what":"extract locations — sf_coordinates","title":"extract locations — sf_coordinates","text":"Extract locations sf objects.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"extract locations — sf_coordinates","text":"","code":"sf_coordinates(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"extract locations — sf_coordinates","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"extract locations — sf_coordinates","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_coordinates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"extract locations — sf_coordinates","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) sf_coordinates(pts) #> X Y #> [1,] 321692.1 4004615 #> [2,] 327093.8 3988283 #> [3,] 319413.4 3999016 #> [4,] 295859.7 4000298 #> [5,] 309115.1 4006437 #> [6,] 307693.8 4001200 #> [7,] 321477.5 3995153 #> [8,] 290924.8 4004432 #> [9,] 310613.7 4008916 #> [10,] 309759.1 3998739 #> [11,] 325896.0 3998749 #> [12,] 298140.7 4012911 #> [13,] 318763.3 3991847 #> [14,] 317858.4 3996996 #> [15,] 293307.1 3997893 #> [16,] 278505.6 4014720 #> [17,] 328858.7 3990305 #> [18,] 321005.4 4001505 #> [19,] 298956.9 4002763 #> [20,] 303136.9 4004695 #> [21,] 303160.4 4000267 #> [22,] 320048.3 3997191 #> [23,] 297232.5 4004157 #> [24,] 314715.6 4004529 #> [25,] 306744.7 3997831 #> [26,] 333088.5 3999333 #> [27,] 274308.9 4010571 #> [28,] 323286.8 3989089 #> [29,] 314776.0 3993128 #> [30,] 295539.1 3995591 #> [31,] 287423.3 4017138 #> [32,] 320535.1 4006257 #> [33,] 305948.2 3991115 #> [34,] 323973.5 4000410 #> [35,] 289667.1 4012704 #> [36,] 306876.0 4004700 #> [37,] 303835.1 4003091 #> [38,] 331003.9 3997742 #> [39,] 296185.7 4007332 #> [40,] 313987.7 4009508 #> [41,] 305798.0 3996370 #> [42,] 301551.3 3992609 #> [43,] 279032.9 4005677 #> [44,] 324950.1 3986925 #> [45,] 312107.6 3998811 #> [46,] 297161.8 3997411 #> [47,] 284636.8 4021080 #> [48,] 308876.5 4009625 #> [49,] 317285.2 3985330 #> [50,] 322264.5 3997923 #> [51,] 291737.8 4011071 #> [52,] 309791.9 4005098 #> [53,] 308641.6 3999711 #> [54,] 327504.6 3997160 #> [55,] 301821.4 4013119 #> [56,] 318552.1 3990024 #> [57,] 307580.2 3995293 #> [58,] 287731.3 4000289 #> [59,] 287216.1 4004408 #> [60,] 319133.0 3986907 #> [61,] 313478.1 4003469 #> [62,] 302109.9 3994967 #> [63,] 299651.2 4015360"},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"generates distance matrix — sf_distance_matrix","title":"generates distance matrix — sf_distance_matrix","text":"Generates distance matrix sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates distance matrix — sf_distance_matrix","text":"","code":"sf_distance_matrix(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates distance matrix — sf_distance_matrix","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates distance matrix — sf_distance_matrix","text":"matrix.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_distance_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates distance matrix — sf_distance_matrix","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) pts_distm = sf_distance_matrix(pts) pts_distm[1:5,1:5] #> 1 2 3 4 5 #> 1 0.000 17202.47 6045.079 26190.70 12708.31 #> 2 17202.473 0.00 13198.202 33465.33 25550.36 #> 3 6045.079 13198.20 0.000 23588.47 12693.66 #> 4 26190.701 33465.33 23588.471 0.00 14608.23 #> 5 12708.306 25550.36 12693.655 14608.23 0.00"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":null,"dir":"Reference","previous_headings":"","what":"sf object geometry column name — sf_geometry_name","title":"sf object geometry column name — sf_geometry_name","text":"Get geometry column name sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sf object geometry column name — sf_geometry_name","text":"","code":"sf_geometry_name(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sf object geometry column name — sf_geometry_name","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sf object geometry column name — sf_geometry_name","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"sf object geometry column name — sf_geometry_name","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_geometry_name(gzma) #> [1] \"geom\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":null,"dir":"Reference","previous_headings":"","what":"sf object geometry type — sf_geometry_type","title":"sf object geometry type — sf_geometry_type","text":"Get geometry type sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"sf object geometry type — sf_geometry_type","text":"","code":"sf_geometry_type(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"sf object geometry type — sf_geometry_type","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"sf object geometry type — sf_geometry_type","text":"lowercase character vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_geometry_type.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"sf object geometry type — sf_geometry_type","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_geometry_type(gzma) #> [1] \"polygon\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":null,"dir":"Reference","previous_headings":"","what":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"Generates Gauss-Kruger projection epsg coding character corresponding sfj object CGCS2000 spatial reference.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"","code":"sf_gk_proj_cgcs2000(sfj, degree = 6L)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"sfj sf object can converted sf sf::st_as_sf(). degree (optional) 3-degree 6-degree zonal projection, default 6L.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_gk_proj_cgcs2000.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates cgcs2000 Gauss-Kruger projection epsg coding character — sf_gk_proj_cgcs2000","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) |> sf::st_transform(4490) sf_gk_proj_cgcs2000(gzma,3) #> [1] \"EPSG:4547\" sf_gk_proj_cgcs2000(gzma,6) #> [1] \"EPSG:4508\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":null,"dir":"Reference","previous_headings":"","what":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"Generates utm projection epsg coding character corresponding sfj object WGS84 spatial reference.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"","code":"sf_utm_proj_wgs84(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"sfj sf object can converted sf sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"character.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_utm_proj_wgs84.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates wgs84 utm projection epsg coding character — sf_utm_proj_wgs84","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) sf_utm_proj_wgs84(gzma) #> [1] \"EPSG:32649\""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":null,"dir":"Reference","previous_headings":"","what":"generates voronoi diagram — sf_voronoi_diagram","title":"generates voronoi diagram — sf_voronoi_diagram","text":"Generates Voronoi diagram (Thiessen polygons) sf object","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"generates voronoi diagram — sf_voronoi_diagram","text":"","code":"sf_voronoi_diagram(sfj)"},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sfj sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sf object polygon geometry type can converted sf::st_as_sf().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"generates voronoi diagram — sf_voronoi_diagram","text":"sf objects (multi-)point type supported generate voronoi diagram returned result includes geometry column.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/sf_voronoi_diagram.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"generates voronoi diagram — sf_voronoi_diagram","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) pts_v = sf_voronoi_diagram(pts) library(ggplot2) ggplot() + geom_sf(data = pts_v, color = 'red', fill = 'transparent') + geom_sf(data = pts, color = 'blue', size = 1.25) + theme_void()"},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":null,"dir":"Reference","previous_headings":"","what":"only spade power of spatial determinant — spade_psd","title":"only spade power of spatial determinant — spade_psd","text":"spade power spatial determinant","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"only spade power of spatial determinant — spade_psd","text":"","code":"spade_psd(y, hs, wt)"},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"only spade power of spatial determinant — spade_psd","text":"y Dependent variable hs Independent variable wt Spatial weight matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"only spade power of spatial determinant — spade_psd","text":"numeric value","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spade_psd.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"only spade power of spatial determinant — spade_psd","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = inverse_distance_swm(gzma) spade_psd(y = gzma$PS_Score, hs = discretize_vector(gzma$PS_Score,5), wt = wt1) #> [1] 0.9480239"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"Constructs spatial weight matrices based contiguity via spdep package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"","code":"spdep_contiguity_swm( sfj, queen = TRUE, k = NULL, order = 1L, cumulate = TRUE, style = \"W\", zero.policy = TRUE )"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"sfj sf object can converted sf sf::st_as_sf(). queen (optional) TRUE, using queen contiguity, otherwise rook contiguity. Default TRUE. k (optional) number nearest neighbours. Ignore parameter using distance based neighbours construct spatial weight matrices. order (optional) order adjacency object. Default 1. cumulate (optional) Whether accumulate adjacency objects. Default TRUE. style (optional) style can take values W, B, C, S. see spdep::nb2mat(). Default W. zero.policy (optional) FALSE stop error empty neighbour sets, TRUE permit weights list formed zero-length weights vectors. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"k set positive value, using K-Nearest Neighbor Weights.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_contiguity_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"constructs spatial weight matrices based on contiguity — spdep_contiguity_swm","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = spdep_contiguity_swm(gzma, k = 6, style = 'B') wt2 = spdep_contiguity_swm(gzma, queen = TRUE, style = 'B') wt3 = spdep_contiguity_swm(gzma, queen = FALSE, order = 2, style = 'B')"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":null,"dir":"Reference","previous_headings":"","what":"constructs spatial weight matrices based on distance — spdep_distance_swm","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"Constructs spatial weight matrices based distance via spdep package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"","code":"spdep_distance_swm( sfj, kernel = NULL, k = NULL, bandwidth = NULL, power = 1, style = \"W\", zero.policy = TRUE )"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"sfj sf object can converted sf sf::st_as_sf(). kernel (optional) kernel function, can one uniform, triangular,quadratic(epanechnikov),quartic gaussian. Default NULL. k (optional) number nearest neighbours. Default NULL. useful kernel provided. bandwidth (optional) bandwidth, default NULL. spatial reference sf object geographical coordinate system, unit bandwidth km. unit used projection coordinate system consistent used sf object coordinate system. power (optional) Default 1. Useful kernel provided. style (optional) style can take values W, B, C, S. see spdep::nb2mat(). Default W. spatial weights based distance functions, style B means using original value calculated distance function. zero.policy (optional) FALSE stop error empty neighbour sets, TRUE permit weights list formed zero-length weights vectors. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"five different kernel weight functions: uniform: \\(K_{(z)} = 1/2\\),\\(\\lvert z \\rvert < 1\\) triangular \\(K_{(z)} = 1 - \\lvert z \\rvert\\),\\(\\lvert z \\rvert < 1\\) quadratic (epanechnikov) \\(K_{(z)} = \\frac{3}{4} \\left( 1 - z^2 \\right)\\),\\(\\lvert z \\rvert < 1\\) quartic \\(K_{(z)} = \\frac{15}{16} {\\left( 1 - z^2 \\right)}^2\\),\\(\\lvert z \\rvert < 1\\) gaussian \\(K_{(z)} = \\frac{1}{\\sqrt{2 \\pi}} e^{- \\frac{z^2}{2}}\\) equation , \\(z = d_{ij} / h_i\\) \\(h_i\\) bandwidth","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"kernel setting, using distance weight based kernel function, Otherwise inverse distance weight used.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_distance_swm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"constructs spatial weight matrices based on distance — spdep_distance_swm","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) wt1 = spdep_distance_swm(pts, style = 'B') wt2 = spdep_distance_swm(pts, kernel = 'gaussian') wt3 = spdep_distance_swm(pts, k = 3, kernel = 'gaussian') wt4 = spdep_distance_swm(pts, k = 3, kernel = 'gaussian', bandwidth = 10000)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial linear models selection — spdep_lmtest","title":"spatial linear models selection — spdep_lmtest","text":"spatial linear models selection","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial linear models selection — spdep_lmtest","text":"","code":"spdep_lmtest(formula, data, listw = NULL)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial linear models selection — spdep_lmtest","text":"formula formula linear regression model. data sf object observation data. listw (optional) listw. See spdep::mat2listw() spdep::nb2listw() details.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial linear models selection — spdep_lmtest","text":"list","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_lmtest.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial linear models selection — spdep_lmtest","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) spdep_lmtest(PS_Score ~ ., gzma) #> \tRao's score (a.k.a Lagrange multiplier) diagnostics for spatial #> \tdependence #> data: #> model: stats::lm(formula = formula, data = data) #> test weights: listw #> #> statistic parameter p.value #> RSerr 66.8965 1 3.331e-16 *** #> RSlag 59.1366 1 1.465e-14 *** #> adjRSerr 8.2199 1 0.004143 ** #> adjRSlag 0.4600 1 0.497622 #> SARMA 67.3565 2 2.331e-15 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":null,"dir":"Reference","previous_headings":"","what":"construct neighbours list — spdep_nb","title":"construct neighbours list — spdep_nb","text":"construct neighbours list","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"construct neighbours list — spdep_nb","text":"","code":"spdep_nb(sfj, queen = TRUE, k = NULL, order = 1L, cumulate = TRUE)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"construct neighbours list — spdep_nb","text":"sfj sf object can converted sf sf::st_as_sf(). queen (optional) TRUE, using queen contiguity, otherwise rook contiguity. Default TRUE. k (optional) number nearest neighbours. Ignore parameter using distance based neighbours. order (optional) order adjacency object. Default 1. cumulate (optional) Whether accumulate adjacency objects. Default TRUE.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"construct neighbours list — spdep_nb","text":"neighbours list class nb","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"construct neighbours list — spdep_nb","text":"k set positive value, using K-Nearest Neighbor","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_nb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"construct neighbours list — spdep_nb","text":"","code":"pts = sf::read_sf(system.file('extdata/pts.gpkg',package = 'sdsfun')) nb1 = spdep_nb(pts, k = 6) nb2 = spdep_nb(pts, queen = TRUE) nb3 = spdep_nb(pts, queen = FALSE, order = 2)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial c(k)luster analysis by tree edge removal — spdep_skater","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"SKATER forms clusters spatially partitioning data similar values features interest.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"","code":"spdep_skater(sfj, k = 6, nb = NULL, ini = 5, ...)"},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"sfj sf object observation data. Please ensure attribute columns included SKATER analysis. k (optional) number clusters. Default 6. nb (optional) neighbours list class nb. input nb NULL, constructed automatically using spdep_nb(). ini (optional) initial node minimal spanning tree. Defaul 5. ... (optional) parameters passed spdep::skater().","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"numeric vector clusters.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spdep_skater.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial c(k)luster analysis by tree edge removal — spdep_skater","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) gzma_c = spdep_skater(gzma,8) gzma$group = gzma_c plot(gzma[\"group\"])"},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":null,"dir":"Reference","previous_headings":"","what":"spatial variance — spvar","title":"spatial variance — spvar","text":"spatial variance","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"spatial variance — spvar","text":"","code":"spvar(x, wt, method = c(\"cpp\", \"r\"))"},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"spatial variance — spvar","text":"x numerical vector . wt spatial weight matrix. method (optional) method calculating spatial variance, can chosen either cpp r. Default cpp.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"spatial variance — spvar","text":"numerical value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"spatial variance — spvar","text":"spatial variance formula \\(\\Gamma = \\frac{\\sum_i \\sum_{j \\neq } \\omega_{ij}\\frac{(y_i-y_j)^2}{2}}{\\sum_i \\sum_{j \\neq } \\omega_{ij}}\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/spvar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"spatial variance — spvar","text":"","code":"gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun')) wt1 = inverse_distance_swm(gzma) spvar(gzma$PS_Score,wt1) #> [1] 2.406486"},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":null,"dir":"Reference","previous_headings":"","what":"test explanatory power of spatial stratified heterogeneity — ssh_test","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"Spatial stratified heterogeneity test based geographical detector q value.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"","code":"ssh_test(y, hs)"},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"y Variable Y, continuous numeric vector. hs Spatial stratification classification explanatory variable. factor, character, integer data.frame, tibble sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"tibble","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"C++ implementation factor_detector function gdverse package.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/ssh_test.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"test explanatory power of spatial stratified heterogeneity — ssh_test","text":"","code":"ssh_test(y = 1:7, hs = c('x',rep('y',3),rep('z',3))) #> # A tibble: 1 × 2 #> Qvalue Pvalue #> #> 1 0.857 0.0528"},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"standardization — standardize_vector","title":"standardization — standardize_vector","text":"calculate Z-score using variance normalization, formula follows: \\(Z = \\frac{(x - mean(x))}{sd(x)}\\)","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"standardization — standardize_vector","text":"","code":"standardize_vector(x)"},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"standardization — standardize_vector","text":"x numeric vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"standardization — standardize_vector","text":"standardized numeric vector","code":""},{"path":"https://stscl.github.io/sdsfun/reference/standardize_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"standardization — standardize_vector","text":"","code":"standardize_vector(1:10) #> [1] -1.4863011 -1.1560120 -0.8257228 -0.4954337 -0.1651446 0.1651446 #> [7] 0.4954337 0.8257228 1.1560120 1.4863011"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":null,"dir":"Reference","previous_headings":"","what":"convert discrete variables in a tibble to integers — tbl_all2int","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"convert discrete variables tibble integers","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"","code":"tbl_all2int(tbl)"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"tbl tibble,data.frame sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"converted tibble,data.frame sf object.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_all2int.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"convert discrete variables in a tibble to integers — tbl_all2int","text":"","code":"demotbl = tibble::tibble(x = c(1,2,3,3,1), y = letters[1:5], z = c(1L,1L,2L,2L,3L), m = factor(letters[1:5],levels = letters[5:1])) tbl_all2int(demotbl) #> # A tibble: 5 × 4 #> x y z m #> #> 1 1 1 1 5 #> 2 2 2 1 4 #> 3 3 3 2 3 #> 4 3 4 2 2 #> 5 1 5 3 1"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":null,"dir":"Reference","previous_headings":"","what":"convert xyz tbl to matrix — tbl_xyz2mat","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"convert xyz tbl matrix","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"","code":"tbl_xyz2mat(tbl, x = 1, y = 2, z = 3)"},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"tbl tibble,data.frame sf object. x (optional) x-axis coordinates column number, default 1. y (optional) y-axis coordinates column number, default 2. z (optional) z (attribute) coordinates column number, default 3.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"list. z_attrs_matrix matrix attribute information. x_coords_matrix matrix x-axis coordinates. y_coords_matrix matrix y-axis coordinates.","code":""},{"path":"https://stscl.github.io/sdsfun/reference/tbl_xyz2mat.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"convert xyz tbl to matrix — tbl_xyz2mat","text":"","code":"set.seed(42) lon = rep(1:3,each = 3) lat = rep(1:3,times = 3) zattr = rnorm(9, mean = 10, sd = 1) demodf = data.frame(x = lon, y = lat, z = zattr) demodf #> x y z #> 1 1 1 11.370958 #> 2 1 2 9.435302 #> 3 1 3 10.363128 #> 4 2 1 10.632863 #> 5 2 2 10.404268 #> 6 2 3 9.893875 #> 7 3 1 11.511522 #> 8 3 2 9.905341 #> 9 3 3 12.018424 tbl_xyz2mat(demodf) #> $z_attrs_matrix #> [,1] [,2] [,3] #> [1,] 10.363128 9.893875 12.018424 #> [2,] 9.435302 10.404268 9.905341 #> [3,] 11.370958 10.632863 11.511522 #> #> $x_coords_matrix #> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 1 2 3 #> [3,] 1 2 3 #> #> $y_coords_matrix #> [,1] [,2] [,3] #> [1,] 3 3 3 #> [2,] 2 2 2 #> [3,] 1 1 1 #>"},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-070","dir":"Changelog","previous_headings":"","what":"sdsfun 0.7.0","title":"sdsfun 0.7.0","text":"Handling NA Values Specifically rm_lineartrend() (#29).","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-060","dir":"Changelog","previous_headings":"","what":"sdsfun 0.6.0","title":"sdsfun 0.6.0","text":"CRAN release: 2024-12-11 Add support removing variable linear trend based covariate (#23). Adds support converting long-form tables matrices corresponding two-dimensional spatial positions (#20). aggregation method hierarchical clustering hclustgeo_disc() set ward.D2 default (#18).","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-050","dir":"Changelog","previous_headings":"","what":"sdsfun 0.5.0","title":"sdsfun 0.5.0","text":"CRAN release: 2024-11-25 Add hclustgeo_disc hierarchical clustering spatial soft constraints (#13). Add spade_psd fast estimation SPADE model psd-value. Add sf_gk_proj_cgcs2000() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-043","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.3","title":"sdsfun 0.4.3","text":"CRAN release: 2024-11-15 Add geodetector_q fast estimation geodetector q-value.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-042","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.2","title":"sdsfun 0.4.2","text":"CRAN release: 2024-11-11 Add check_tbl_na tbl_all2int functions better support gdverse sesp packages.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-041","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.1","title":"sdsfun 0.4.1","text":"CRAN release: 2024-10-16 Fix bug causes R crash input x factor character discretize_vector function (#12). Implement formula_varname function return corresponding variable names formula data.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-040","dir":"Changelog","previous_headings":"","what":"sdsfun 0.4.0","title":"sdsfun 0.4.0","text":"CRAN release: 2024-10-08 Improve handling n-level categorical variables generating n-1 dummy variables (#2). Add spdep_lmtest function spatial linear model selection (#3). Migrate moran_test function geocomplexity package sdsfun (#4). Implement geographical detector’s factor detector ssh_test using Rcpp enhance performance (#5). Introduce discretize_vector function support variable discretization (#6). Apply loess_optnum function select optimal number discretization intervals (#10). Implement spatial variance calculation spvar function, support R C++ implementations (#11). Rename dummy_vector dummy_vec consistency naming conventions. Add sf_coordinates function extract coordinates sf objects.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-030","dir":"Changelog","previous_headings":"","what":"sdsfun 0.3.0","title":"sdsfun 0.3.0","text":"CRAN release: 2024-09-30 Begin use Rcpp complete tasks high computational complexity. Add dummy_vector dummy_tbl functions dummy variables generation. Add spdep_nb function neighbours list generation. Add spdep_skater function spatial constrained clustering. Add fuzzyoverlay function spatial fuzzy overlay. Update package extdata; now sdsfun two extdata: gzma.gpkg pts.gpkg.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-021","dir":"Changelog","previous_headings":"","what":"sdsfun 0.2.1","title":"sdsfun 0.2.1","text":"CRAN release: 2024-09-23 Enhance support types spatial vector data. Inhibit warning information produced spdep. Add sf_utm_proj_wgs84() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-020","dir":"Changelog","previous_headings":"","what":"sdsfun 0.2.0","title":"sdsfun 0.2.0","text":"CRAN release: 2024-09-15 Add sf_distance_matrix() function.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-011","dir":"Changelog","previous_headings":"","what":"sdsfun 0.1.1","title":"sdsfun 0.1.1","text":"CRAN release: 2024-09-08 Update function documentation spdep_contiguity_swm() spdep_distance_swm(). Move source code SpatLyu/sdsfun GitHub stscl/sdsfun.","code":""},{"path":"https://stscl.github.io/sdsfun/news/index.html","id":"sdsfun-010","dir":"Changelog","previous_headings":"","what":"sdsfun 0.1.0","title":"sdsfun 0.1.0","text":"CRAN release: 2024-08-30 Initial CRAN submission.","code":""}]