View source: R/residuals.cartogramR.R
residuals.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; 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. |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.