| wif_match | R Documentation |
Matches datasets by group and preserves baseline scenarios (scenario_id=0) when scenarios differ between them.
wif_match(x, y, by = NULL)
x |
First dataset to match |
y |
Second dataset to match |
by |
Grouping variable(s) to match on, defaults to NULL |
List containing matched datasets with aligned scenario IDs:
First element: matched version of dataset x
Second element: matched version of dataset y
x <- data.frame(
category = c("a", "b", "a", "b"),
scenario_id = c(0, 0, 1, 1),
value = 1:4
)
y <- data.frame(
category = c("a", "b", "a", "b"),
scenario_id = c(0, 0, 2, 2),
value = 5:8
)
# Automatic matching
result <- wif_match(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.