It calculates the Mapcurves's goodness-of-fit (GOF)

mapcurves_calc(x, y, x_name, y_name, precision = NULL)

# S3 method for sf
mapcurves_calc(x, y, x_name, y_name, precision = NULL)

# S3 method for RasterLayer
mapcurves_calc(x, y, x_name = NULL,
  y_name = NULL, precision = NULL)

Arguments

x

An object of class sf with a POLYGON or MULTIPOLYGON geometry type.

y

An object of class sf with a POLYGON or MULTIPOLYGON geometry type.

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 units with distance units (but see details); see st_as_binary for how to do this.

Value

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

References

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.

Examples

#> Linking to GEOS 3.5.0, GDAL 2.2.2, PROJ 4.8.0
data("regions1") data("regions2") mc = mapcurves_calc(x = regions1, y = regions2, x_name = z, y_name = z) mc
#> The MapCurves results: #> #> The goodness of fit: 0.61 #> Reference map: x #> #> The spatial objects can be retrieved with: #> $map1 - the first map #> $map2 - the second map
plot(mc$map1)
plot(mc$map2)