Description Usage Arguments Value Examples
The only requirement for this function to work is that the first row and last row of the tibble represent the cash in and cash out. In other words the Base and the Total when talking about sales modeling.
1 |
data |
the data tibble to operate on |
a ggplot of the waterfall plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(ggplot2)
datadf <-
tibble::tibble(
desc = c(
"starting_net_income",
"write_offs",
"sales",
"COGS",
"overhead",
"taxes",
"bonuses",
"other_income",
"ending_net_income"
),
amount = c(1200, -2300, 11000, -9000, -1900, -1200, -3000, 7000, 1800)
)
plot_waterfall(datadf) +
scale_fill_brewer(type = "seq", palette = 4) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.9, hjust = 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.