residuals.cartogramR: Errors of a cartogram object

View source: R/residuals.cartogramR.R

residuals.cartogramRR Documentation

Errors of a cartogram object

Description

Errors of a cartogram object

Usage

## S3 method for class 'cartogramR'
residuals(object, ...)

Arguments

object

a cartogramR object

...

arguments passed to or from other methods. The following arguments are available: - type; a character string giving the type of residuals (see details; can be abbreviated) - "relative error" - "absolute error" - "symmetric difference" - center; a character string giving the type of center (can be abbreviated): - "point_on_surface" (sf::st_point_on_surface applied on original and on deformed/cartogram region). - "deformed_center" (the center function, see cartogramR_options, is applied on region and this center follows the deformation giving the center on the deformed/cartogram region) - "centroid" (centroid of original and deformed/cartogram region). - initial_data; the initial sf object given as input of cartogramR. Only needed for symmetric differences residuals.

Details

The error vector contains the values of the differences between actual area of regions in the cartogram and theorical area (obtained with conservation of total area and constant density over region in the final cartogram)

Relative error are the error vector divided by the theorical area

Symmetric difference are the symmetric difference between
actual area of regions in the cartogram and the original
area. Each region is scaled to have an area equal to 1 and centered
around the chosen center.

Value

A numeric vector which contains for each region observed area minus theorical area

Examples


  data(usa)
  carto <- cartogramR(usa, "electors64")
  residuals(carto)



cartogramR documentation built on Sept. 11, 2024, 5:48 p.m.