gl.colors | R Documentation |
Creates a vector of colors in hex (e.g. "#3B9AB2" "#78B7C5") based on user selected category (parameter type).
"2" [two colors]
"2c" [two colors contrast]
"3" [three colors]
4" [four colors]
"pal" [need to be specify the palette type and the number of colors]
A palette of colors can be specified via "div" [divergent], "dis" [discrete], "con" [convergent], "vir" [viridis]. Be aware a palette needs the number of colors specified as well. It returns a function and therefore the number of colors needs to be a part of the function call. Check the examples to see how this works.
gl.colors(type = 2, verbose = NULL)
type |
Type of color (2, 3 or 4 colors, or palette, see description) [default 2]. |
verbose |
– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity]. |
returns colors as a vector
Custodian: Bernd Gruber – Post to https://groups.google.com/d/forum/dartr
Other graphics:
gl.map.interactive()
,
gl.plot.heatmap()
,
gl.report.ld.map()
,
gl.select.colors()
,
gl.select.shapes()
,
gl.smearplot()
,
gl.tree.nj()
gl.colors(2)
gl.colors("2")
gl.colors("2c")
#five discrete colors
gl.colors(type="dis")(5)
#seven divergent colors
gl.colors("div")(7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.