View source: R/data_bars_gradient.R
data_bars_gradient | R Documentation |
The 'data_bars_gradient()' function is depreciated. The new version of 'data_bars()' can convert colors into gradients with 'gradient = TRUE'. Please use 'data_bars()' instead.
data_bars_gradient( data, colors = c("#1efffd", "#1e20ff"), background = "white", number_fmt = NULL )
data |
Dataset containing at least one numeric column. |
colors |
A vector of colors of at least two colors. Colors should be given in order from left to right as shown on the data bar. Default colors are c("#1efffd", "#1e20ff"). |
background |
Optionally assign a color to use as the background for cells. Default is set to white. |
number_fmt |
Optionally format numbers using formats from the scales package. Default is set to NULL. |
a function that applies data bars to a column of numeric values.
data <- MASS::Cars93[20:49, c("Make", "MPG.city", "MPG.highway")] ## By default, colors are provided reactable(data, defaultColDef = colDef( align = "left", cell = data_bars(data, fill_color = c("#1efffd", "#1e20ff"), fill_gradient = TRUE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.