Description Usage Arguments Examples
View source: R/counterfactual_f.R
Data transformation
1 | pivot(data_input, columns, groups)
|
data_input |
Data |
columns |
Columns representing different values |
groups |
Name of the groups |
1 2 3 4 5 6 7 8 9 | ## Calculate counterfactual scenarios under different scenarios
data("sales_data")
sales_data %>%
pivot(c("cs1", "cs2"), c("cs1", "cs2")) %>%
filter(date %in% c(baseline_period, campaign_period)) %>%
ggplot() +
geom_line(aes(x = date, y = total, col = group)) +
geom_vline(xintercept = min(campaign_period))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.