Description Usage Arguments Author(s) Examples
Full document: European Centre for Disease Prevention and Control. Guidelines for presentation of surveillance data. Stockholm: ECDC; 2018. Available from: Guidelines for presentation of surveillance data
1 2 | SurvColors(col_scale = "green", n = NULL, grey_shade = NULL,
hot_cols = NULL)
|
col_scale |
Selected colour scale, defaults to 'green'. Select from 'green', 'blue', 'red', 'grey', 'qual(itative)' or 'hot(cold)' |
n |
Number of colours from each colour scale, apart from grey, in order indicated in the guidelines. Defaults to one colour, apart from two colours for the hotcold scale, max 7-8 colours for each scale. To select grey shades, use the argument grey_shade; to select number of hot (warm) colours in the hotcold scale, use the argument hot_cols. |
grey_shade |
Only used with grey colours, defaults to 'medium'. Selected shade(s) of grey in selected order; c('light', 'mediumlight','medium','mediumdark','dark'). Overrides given number of colours (n). |
hot_cols |
Selected number of hot (warm) colours in the hotcold colour scale, use only for hotcold. Must be smaller than the total number of colours (n). Defaults to floored half of total hotcold colours. |
Tommi Karki
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Select three first green colours
SurvColors("green", n=3)
# Select two first qualitative colours
SurvColors("qual", n=2)
# Select seven red colours
SurvColors("red", n=7)
SurvColors("grey", grey_shade = c("mediumlight", "dark"))
# Use in a graph
# Dummy data
mydat <- data.frame(ID = c(seq(1,10,1)),
Gender = c(rep(c("F", "M"),5)))
barplot(table(mydat$Gender), col = SurvColors(col_scale = "qual", n=2))
# Hot-cold colour scale
barplot(c(1:4), col = SurvColors(col_scale = "hotcold", n = 4, hot_cols = 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.