View source: R/gt_plot_bar_range.R
gt_plot_bar_range | R Documentation |
After gtExtras::gt_plot_bar_stack. The gt_plot_bar_range takes an existing gt_tbl object and converts the existing values into a stacked barchart.
gt_plot_bar_range(gt_object, column)
gt_object |
An existing gt table object of class gt_tbl |
column |
The column wherein the stacked barchart should replace existing data. Note that the data must be represented as a list of three numeric values and an optional color value ahead of time. |
team_a_name |
name of team A |
team_b_name |
name of team B |
n_sim |
number of simulations to run |
seed |
seed for reproducibility |
A list of two data frames: 1) win-win-draw probabilities and 2) result probabilities
## Not run:
ex_df <- tibble(
x = c("load", "sumad", "spd", "hsrp", "tdc"),
list_data = list(c(75, 50, 75, "purple"), c(150, 50, 0, "blue"), c(0, 25, 175, "red"),
c(50, 100, 50, "orange"), c(50, 50, 100, "green"))
)
ex_tab <- ex_df %>%
gt() %>%
gt_plot_bar_range(column = list_data)
ex_tab
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.