Description Usage Arguments Value Examples
View source: R/div_gauge_plot.R
This function produces one or more gauge plots coloured in red (R), amber (A) or green (G) for a value between 0 and 1.
1 | div_gauge_plot(df, breaks = c(0, 0.8, 0.95, 1), ncol = NULL, nbrSize = 6)
|
df |
tibble, a tibble with columns "value" and "label" (value = the values between 0 and 1; - label = text to show e.g. paste("group", colnames(t))) |
breaks |
numeric vector with the lower limit, the border between green and amber, the border between amber and red, and the upper limit |
ncol |
numeric, the number of columns to produce |
nbrSize |
numeric, the font size for the label |
ggplot object
1 2 3 4 5 | d <- div_fake_team()
tbl_gender_div <- table(d$gender, d$grade) %>%
apply(2, diversity, prior = c(50.2, 49.8)) %>%
tibble(value = ., label = paste("Grade", names(.)))
div_gauge_plot(tbl_gender_div, ncol = 2, nbrSize = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.