cartogramR_options {cartogramR}R Documentation

Set the options of cartogramR in the correct format

Description

Set the options of cartogramR in the correct format

Usage

cartogramR_options(
  options,
  method = c("gsm", "gn", "dcn", "GastnerSeguyMore", "GastnerNewman",
    "DougenikChrismanNiemeyer")
)

Arguments

options

a named list with some (or all) the following components:

  • maxit: (all method) the maximum number of iterations, default to 50.

  • absrel: (all method) boolean, if TRUE relative convergence stopping criterion is used ; if FALSE absolute convergence stopping criterion is used (default to TRUE)

  • abserror: (all method) Areas on cartogram differ at most by an (absolute value of) error of abserror. That is, \max_{p} |\hat A_p - A_p| \leq abserror. The max is over all polygons p, hat A_p is the area calculated by the cartogram for polygon p and A_p is the objective area, (default to 10000)

  • abstol: ("dcn") the absolute convergence error tolerance: \max_{p} | \hat A_p(i) - \hat A_p(i-1)| \leq abstol, the max over all polygons p of the difference of area calculated by the cartogram at step i and those at step i-1, (default to 1000)

  • relerror: (all method) Areas on cartogram differ at most by an (absolute value of) relative error of relerror. That is, \max_{p} |\hat A_p / A_p - 1| \leq relerror. The max is over all polygons p, hat A_p is the area calculated by the cartogram for polygon p and A_p is the objective area, (default to 0.01)

  • reltol: ("dcn") the relative convergence tolerance: \max_{p} |\hat A_p(i) - \hat A_p(i-1)|/\hat A_p(i-1) \leq reltol (default to 1e-3)

  • L: (⁠"gsm" or "gn"⁠) integer, gives the value of L (default is 512), must be a power of two (for fftw)

  • mp: (all method) if a region contains exactly zero population, it will be replaced by mp times the smallest (strictly) positive population in any region (default to 0.2)

  • pf: (⁠"gsm" or "gn"⁠) Determines space between map and boundary (default to 1.5)

  • sigma: (⁠"gsm" or "gn"⁠) Width of Gaussian blur to smoothen the density (default to 5)

  • center: (⁠"gsm" or "gn"⁠) either a character string (only possible choices are "centroid" or "point_on_surface") or a function. If the object is a function, it will be used to calculate the "center" of polygons; "point_on_surface" will use the function sf::st_point_on_surface while "centroid" (the default) will use sf::st_centroid.

  • verbose: (all method) integer giving the verbosity level (default to 0, not verbose)

  • grid: (⁠"gsm" or "gn"⁠) boolean, if TRUE export the final grid from flow algorithm (default to TRUE). Setting to FALSE

  • check.ring.dir: (all method) boolean, if TRUE controls polygons orientation (default to TRUE)

  • check.only: (all method) boolean, if TRUE control only polygons orientation and no replacement is done (default to FALSE)

method

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

Value

a list to be processed by cartogramR

References

Examples


  data(usa)
  carto1 <- cartogramR(usa, "electors64", options=list(verbose=1, L=256))
  plot(carto1)



[Package cartogramR version 1.0-10 Index]