residuals.cartogramR {cartogramR} | R Documentation |
Errors of a cartogram object
## S3 method for class 'cartogramR'
residuals(object, ...)
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) - "relative error" - "absolute error" - "symmetric difference" - center ; a character string giving the type of center: - "point_on_surface" (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). Can be abbreviated. |
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.
A numeric vector which contains for each region observed area minus theorical area
data(usa)
carto <- cartogramR(usa, "electors64")
residuals(carto)