match_df {plyr}R Documentation

Extract matching rows of a data frame.

Description

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, on = NULL)

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

See Also

join to combine the columns from both x and y

Examples

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

[Package plyr version 1.7.1 Index]