precartogramR {cartogramR}R Documentation

Make a pre cartogram analysis

Description

Make a pre cartogram analysis

Usage

precartogramR(
  data,
  method = c("gsm", "gn", "dcn", "GastnerSeguyMore", "GastnerNewman",
    "DougenikChrismanNiemeyer"),
  gridpower2 = 8:11,
  pf = 1.5,
  verbose = FALSE
)

Arguments

data

a sf object which contains at least two columns: obviously a geometry column (giving the map) and a column which contains a count by region (leading to a density by region, density to be equalized by deformation). Each row of data is a region and contains the simple feature geometry of type POLYGON or MULTIPOLYGON. Polygon ring directions are not checked but exterior ring must counter clockwise and holes clockwise (use option check_ring_dir of sf::st_read to achieve the right orientation of ring direction on import or use check_ring_dir function)

method

the method to be used, can be one of the following: gsm or GastnerSeguyMore (default), gn or GastnerNewman, dcn or DougenikChrismanNiemeyer.

gridpower2

a vector of exponent (to be raised at the power of 2) that gives the log2(size) of the grid (default to 8:11); meaningful for method gsm or GastnerSeguyMore (default), gn or GastnerNewman

pf

Determines space between map and boundary (default to 1.5); meaningful for method gsm or GastnerSeguyMore (default), gn or GastnerNewman

verbose

a boolean object to set on verbose mode (default to FALSE); meaningful for method gsm or GastnerSeguyMore (default), gn or GastnerNewman

Value

either a dbv.cartogramR object (if method is dcn or DougenikChrismanNiemeyer) see dist_between_vertices for details or a gridanalysis.cartogramR (if method is gsm or GastnerSeguyMore (default), gn or GastnerNewman) see grid_analysis for details

References

Examples


  data(usa)
  precarto <- precartogramR(usa)
  plot(precarto)
  summary(precarto)



[Package cartogramR version 1.0-7 Index]