Skip to contents

Match and align keys between two datasets

Usage

keys_match(x, y, keys_names = NULL)

Arguments

x

First dataset containing keys to match

y

Second dataset containing keys to match

keys_names

Names of columns to use as matching keys. If NULL, uses common columns

Value

List containing:

x

First dataset with group IDs

y

Second dataset with group IDs

xy

Matched datasets with aligned group and scenario IDs

Examples

if (FALSE) { # \dontrun{
x <- data.frame(
  type = c("1", "2"),
  category = c("a", "b"),
  scenario_id = c(0, 1)
)

y <- data.frame(
   type = c("1", "2"),
   category = c("c", "d"),
   scenario_id = c(0, 2)
 )

keys_match(x, y)
} # }