find_player: Find all the matches of a player

Description Usage Arguments Value Examples

View source: R/players.R

Description

Query function to return the matches of one or more players in the data set. Function is case-insensitive, all names will be set to lower before matching.

Usage

1
find_player(x, ..., won_lost = c("both", "won", "lost"))

Arguments

x

A data frame from the tennis package.

...

Character string of the full player name(s). Multiple player names are separated by a comma.

won_lost

Character string indicating if only the won matches, lost matches, or both should be returned.

Value

A subset of x with the matches of the requested players.

Examples

1
2
library(dplyr)
atp_matches %>% find_player("roger federer", "Rafael Nadal", "NOVAK DJOKOVIC")

EdwinTh/tennis documentation built on Jan. 13, 2020, 2:38 p.m.