Skip to contents

Match works in the same way as join, but instead of return the combined dataset, it only returns the matching rows from the first dataset. This is particularly useful when you've summarised the data in some way and want to subset the original data by a characteristic of the subset.

Usage

match_df(x, y, out = NULL, on = NULL, verbose = FALSE)

Arguments

x

data frame to subset.

y

data frame defining matching rows.

out

obj Of class matching the desired output. Default NULL returns a data.frame with the matching row in y. numeric() will return the matching index in y & logical() will return a matching logical index

on

variables to match on - by default will use all variables common to both data frames.

Value

tbl/dbl/lgl Depending on

See also

plyr::match_df