Skip to contents

Join two data frames using data.table

Usage

join_dtf(d1, d2, k1, k2)

Arguments

d1

Data frame 1

d2

Data frame 2

k1

Key columns for data frame 1

k2

Key columns for data frame 2

Value

Joined data frame

Examples


# Example usage:
df1 <- data.frame(id = 1:5, value = letters[1:5])
df2 <- data.frame(id = 1:5, category = LETTERS[1:5])
join_dtf(df1, df2, "id", "id")
#>   id value category
#> 1  1     a        A
#> 2  2     b        B
#> 3  3     c        C
#> 4  4     d        D
#> 5  5     e        E