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 new data tibble with columns necessary to create a waterfall visualization
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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)
)
to_waterfall(datadf)
# Change order
datadf2 <- to_waterfall(datadf)
firstindex <- which(datadf$desc == "sales")
datadf2[c(firstindex, setdiff(seq_along(datadf$amount), firstindex)), ]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.