Learn R Programming

sabre (version 0.4.3)

mapcurves_calc: Mapcurves calculation

Description

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

Usage

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 stars mapcurves_calc(x, y, x_name = NULL, y_name = NULL, precision = NULL)

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

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

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

Arguments

x

An object of class sf with a POLYGON or MULTIPOLYGON geometry type or a spatial raster object of class RasterLayer, SpatRaster, or stars.

y

An object of class sf with a POLYGON or MULTIPOLYGON geometry type or a spatial raster object of class RasterLayer, SpatRaster, or stars.

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.

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

Run this code
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)

Run the code above in your browser using DataLab