gauge | R Documentation |
A gauge displays a numeric value on a meter that runs between specified minimum and maximum values.
gauge(
value,
min,
max,
sectors = gaugeSectors(),
symbol = NULL,
label = NULL,
abbreviate = TRUE,
abbreviateDecimals = 1,
href = NULL
)
gaugeSectors(
success = NULL,
warning = NULL,
danger = NULL,
colors = c("success", "warning", "danger")
)
value |
Numeric value to display |
min |
Minimum numeric value |
max |
Maximum numeric value |
sectors |
Custom colored sectors (e.g. "success", "warning", "danger"). By default all values are colored using the "success" theme color |
symbol |
Optional symbol to show next to value (e.g. 'kg') |
label |
Optional label to display beneath the value |
abbreviate |
Abbreviate large numbers for min, max, and value
(e.g. 1234567 -> 1.23M). Defaults to |
abbreviateDecimals |
Number of decimal places for abbreviated numbers to contain (defaults to 1). |
href |
An optional URL to link to. Note that this can be an anchor of another dashboard page (e.g. "#details"). |
success |
Two-element numeric vector defining the range of values to
color as "success" (specific color provided by theme or custom |
warning |
Two-element numeric vector defining the range of values to
color as "warning" (specific color provided by theme or custom |
danger |
Two-element numeric vector defining the range of values to
color as "danger" (specific color provided by theme or custom |
colors |
Vector of colors to use for the |
See the flexdashboard website for additional documentation: <https://pkgs.rstudio.com/flexdashboard/articles/using.html#gauges>
library(flexdashboard)
gauge(42, min = 0, max = 100, symbol = '%', gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.