library(dplyr)
##
## Attaching package: 'dplyr'
##
## The following objects are masked from 'package:stats':
##
## filter, lag
##
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
left_join(
data_frame(x = c("a", "a"),
y = c("B", "C")),
data_frame(x = c("a", "a"),
z = c("1", "2")),
by = "x"
)
## Source: local data frame [4 x 3]
##
## x y z
## (chr) (chr) (chr)
## 1 a B 1
## 2 a B 2
## 3 a C 1
## 4 a C 2