Learn R Programming

plyr (version 1.5.2)

match_df: Extract matching rows of a data frame.

Description

Extract matching rows of a data frame.

Usage

match_df(x, y, on)

Arguments

x
data frame to subset.
y
data frame defining matching rows.
on
variables to match on - by default will use all variables common to both data frames.

Value

  • a data frame

Details

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.

See Also

join to combine the columns from both x and y

Examples

Run this code
longterm <- subset(count(baseball, "id"), freq > 25)
bb_longterm <- match_df(baseball, longterm)

Run the code above in your browser using DataLab