Title: | Spatial Association Between Regionalizations |
---|---|
Description: | Calculates a degree of spatial association between regionalizations or categorical maps using the information-theoretical V-measure (Nowosad and Stepinski (2018) <doi:10.1080/13658816.2018.1511794>). It also offers an R implementation of the MapCurve method (Hargrove et al. (2006) <doi:10.1007/s10109-006-0025-x>). |
Authors: | Jakub Nowosad [aut, cre] |
Maintainer: | Jakub Nowosad <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.3 |
Built: | 2025-02-12 05:58:05 UTC |
Source: | https://github.com/nowosad/sabre |
Bailey's Ecoregions of the Conterminous United States
eco_us
eco_us
An object of class sf
(inherits from data.frame
) with 330 rows and 5 columns.
https://www.sciencebase.gov/catalog/item/54244abde4b037b608f9e23d
Mapcurves: a quantitative method for comparing categorical maps.
mapcurves(x, y, z = NULL)
mapcurves(x, y, z = NULL)
x |
A numeric vector, representing a categorical values. |
y |
A numeric vector, representing a categorical values. |
z |
A numeric matrix. The goodness of fit (GOF) value for each pair of
classes in |
A list with two elements:
"ref_map" - the map to be used as reference ("x" or "y")
"gof" - the Mapcurves's goodness of fit value
Hargrove, William W., Forrest M. Hoffman, and Paul F. Hessburg. "Mapcurves: a quantitative method for comparing categorical maps." Journal of Geographical Systems 8.2 (2006): 187.
set.seed(2018-03-21) A = floor(matrix(runif(100, 0, 9), 10)) B = floor(matrix(runif(100, 0, 9), 10)) mapcurves(A, B)
set.seed(2018-03-21) A = floor(matrix(runif(100, 0, 9), 10)) B = floor(matrix(runif(100, 0, 9), 10)) mapcurves(A, B)
It calculates the Mapcurves's goodness-of-fit (GOF)
mapcurves_calc(x, y, x_name, y_name, precision = NULL) ## S3 method for class 'sf' mapcurves_calc(x, y, x_name, y_name, precision = NULL) ## S3 method for class 'stars' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL) ## S3 method for class 'SpatRaster' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL) ## S3 method for class 'RasterLayer' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL)
mapcurves_calc(x, y, x_name, y_name, precision = NULL) ## S3 method for class 'sf' mapcurves_calc(x, y, x_name, y_name, precision = NULL) ## S3 method for class 'stars' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL) ## S3 method for class 'SpatRaster' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL) ## S3 method for class 'RasterLayer' mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL)
x |
An object of class |
y |
An object of class |
x_name |
A name of the column with regions/clusters names. |
y_name |
A name of the column with regions/clusters names. |
precision |
numeric, or object of class |
A list with four elements:
"map1" - the sf object containing the first map used for calculation of GOF
"map2" - the sf object containing the second map used for calculation of GOF
"ref_map" - the map used as a reference ("x" or "y")
"gof" - the Mapcurves's goodness of fit value
Hargrove, William W., Forrest M. Hoffman, and Paul F. Hessburg. "Mapcurves: a quantitative method for comparing categorical maps." Journal of Geographical Systems 8.2 (2006): 187.
library(sf) data("regions1") data("regions2") mc = mapcurves_calc(x = regions1, y = regions2, x_name = z, y_name = z) mc plot(mc$map1) plot(mc$map2) library(raster) data("partitions1") data("partitions2") mc2 = mapcurves_calc(x = partitions1, y = partitions2) mc2 plot(mc2$map1) plot(mc2$map2)
library(sf) data("regions1") data("regions2") mc = mapcurves_calc(x = regions1, y = regions2, x_name = z, y_name = z) mc plot(mc$map1) plot(mc$map2) library(raster) data("partitions1") data("partitions2") mc2 = mapcurves_calc(x = partitions1, y = partitions2) mc2 plot(mc2$map1) plot(mc2$map2)
Raster data of the red regionalization used in Figure 1 of Stepinski and Nowosad (2018)
partitions1
partitions1
An object of class RasterLayer
of dimension 8 x 10 x 1.
Nowosad, Jakub, and Tomasz F. Stepinski. "Spatial association between regionalizations using the information-theoretical V-measure." International Journal of Geographical Information Science (2018). https://doi.org/10.1080/13658816.2018.1511794
Raster data of the blue regionalization used in Figure 1 of Stepinski and Nowosad (2018)
partitions2
partitions2
An object of class RasterLayer
of dimension 8 x 10 x 1.
Nowosad, Jakub, and Tomasz F. Stepinski. "Spatial association between regionalizations using the information-theoretical V-measure." International Journal of Geographical Information Science (2018). https://doi.org/10.1080/13658816.2018.1511794
Data of the red regionalization used in Figure 1 of Stepinski and Nowosad (2018)
regions1
regions1
An object of class sf
(inherits from data.frame
) with 4 rows and 2 columns.
Nowosad, Jakub, and Tomasz F. Stepinski. "Spatial association between regionalizations using the information-theoretical V-measure." International Journal of Geographical Information Science (2018). https://doi.org/10.1080/13658816.2018.1511794
Data of the blue regionalization used in Figure 1 of Stepinski and Nowosad (2018)
regions2
regions2
An object of class sf
(inherits from data.frame
) with 3 rows and 2 columns.
Nowosad, Jakub, and Tomasz F. Stepinski. "Spatial association between regionalizations using the information-theoretical V-measure." International Journal of Geographical Information Science (2018). https://doi.org/10.1080/13658816.2018.1511794
A conditional entropy-based external cluster evaluation measure.
vmeasure(x, y, z = NULL, B = 1)
vmeasure(x, y, z = NULL, B = 1)
x |
A numeric vector, representing a categorical values. |
y |
A numeric vector, representing a categorical values. |
z |
A numeric matrix. A contingency table of the counts at each
combination of categorical levels. By default this argument is set to |
B |
A numeric value. If |
A list with three elements:
"v_measure"
"homogeneity"
"completeness"
Rosenberg, Andrew, and Julia Hirschberg. "V-measure: A conditional entropy-based external cluster evaluation measure." Proceedings of the 2007 joint conference on empirical methods in natural language processing and computational natural language learning (EMNLP-CoNLL). 2007.
x = c(1, 1, 1, 2, 2, 3, 3, 3, 1, 1, 2, 2, 2, 3, 3) y = c(rep(1, 5), rep(2, 5), rep(3, 5)) vmeasure(x, y)
x = c(1, 1, 1, 2, 2, 3, 3, 3, 1, 1, 2, 2, 2, 3, 3) y = c(rep(1, 5), rep(2, 5), rep(3, 5)) vmeasure(x, y)
It calculates a degree of spatial association between regionalizations using an information-theoretical measure called the V-measure
vmeasure_calc(x, y, x_name, y_name, B = 1, precision = NULL) ## S3 method for class 'sf' vmeasure_calc(x, y, x_name, y_name, B = 1, precision = NULL) ## S3 method for class 'stars' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL) ## S3 method for class 'SpatRaster' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL) ## S3 method for class 'RasterLayer' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL)
vmeasure_calc(x, y, x_name, y_name, B = 1, precision = NULL) ## S3 method for class 'sf' vmeasure_calc(x, y, x_name, y_name, B = 1, precision = NULL) ## S3 method for class 'stars' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL) ## S3 method for class 'SpatRaster' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL) ## S3 method for class 'RasterLayer' vmeasure_calc(x, y, x_name = NULL, y_name = NULL, B = 1, precision = NULL)
x |
An object of class |
y |
An object of class |
x_name |
A name of the column with regions/clusters names. |
y_name |
A name of the column with regions/clusters names. |
B |
A numeric value. If |
precision |
numeric, or object of class |
A list with five elements:
"map1" - the sf object containing the first preprocessed map used for
calculation of GOF with two attributes - map1
(name of the category)
and rih
(region inhomogeneity)
"map2" - the sf object containing the second preprocessed map used for
calculation of GOF with two attributes - map1
(name of the category)
and rih
(region inhomogeneity)
"v_measure"
"homogeneity"
"completeness"
Nowosad, Jakub, and Tomasz F. Stepinski. "Spatial association between regionalizations using the information-theoretical V-measure." International Journal of Geographical Information Science (2018). https://doi.org/10.1080/13658816.2018.1511794
Rosenberg, Andrew, and Julia Hirschberg. "V-measure: A conditional entropy-based external cluster evaluation measure." Proceedings of the 2007 joint conference on empirical methods in natural language processing and computational natural language learning (EMNLP-CoNLL). 2007.
library(sf) data("regions1") data("regions2") vm = vmeasure_calc(x = regions1, y = regions2, x_name = z, y_name = z) vm plot(vm$map1["rih"]) plot(vm$map2["rih"]) library(raster) data("partitions1") data("partitions2") vm2 = vmeasure_calc(x = partitions1, y = partitions2) vm2 plot(vm2$map1[["rih"]]) plot(vm2$map2[["rih"]])
library(sf) data("regions1") data("regions2") vm = vmeasure_calc(x = regions1, y = regions2, x_name = z, y_name = z) vm plot(vm$map1["rih"]) plot(vm$map2["rih"]) library(raster) data("partitions1") data("partitions2") vm2 = vmeasure_calc(x = partitions1, y = partitions2) vm2 plot(vm2$map1[["rih"]]) plot(vm2$map2[["rih"]])