Description Usage Arguments Value Author(s) References Examples
View source: R/generate_map_colours.R
Generate color indices for shape object with the aim to color neighboring objects with distinct colors.
1 | generate_map_colours(sp, verbose = TRUE)
|
sp |
A SpatialPolygonsDataFrame object |
verbose |
logical. Should R report extra information on progress? |
Color index vector
Modified from the code by Karl Ove Hufthammer from http://r-sig-geo.2731867.n2.nabble.com/Colouring-maps-so-that-adjacent-polygons-differ-in-colour-td6237661.html; modifications by Leo Lahti and Juuso Parkkinen
See citation("gisfin")
1 2 | sp.suuralue <- get_helsinki_aluejakokartat(map.specifier="suuralue");
cols <- factor(generate_map_colours(sp=sp.suuralue));
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.