View source: R/dataframe_utilities.R
partial_join | R Documentation |
Join two dataframes with partial matching of keys
partial_join(x, y, by_x, pattern_y)
x |
A dataframe |
y |
A dataframe |
by_x |
Column to join in x |
pattern_y |
Column to join in y, containing patterns which may result in multiple matches |
If by_x has multiple values that match rows of pattern_y, multiple rows are created by the join.
A dataframe
library(dplyr)
x=data_frame(A=c("AA BB","CC","DD EE"), B=1:3)
y=data_frame(K=c("AA","BB","CC","DD"), Z=c("cat1","cat1","cat1","cat2"))
partial_join(x,y,"A","K")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.