get_matchup: Get a player matchup data from SquashInfo

View source: R/get_matchup.R

get_matchupR Documentation

Get a player matchup data from SquashInfo

Description

Given the full names or ranks of players, and the competition category, get_matchup() returns recent matchup data for PSA ranked players.

Usage

get_matchup(
  player_1 = NULL,
  player_2 = NULL,
  ranks = NULL,
  category = NULL,
  tidy = FALSE,
  match_spread = FALSE
)

Arguments

player_1

character string of the first player's name.

player_2

character string of the second player's name.

ranks

integers indicating the rank of the PSA players to return.

category

character string indicating the competition category. Must be one of "mens" or "womens".

tidy

logical indicating whether to organize results according to tidy principles.

match_spread

logical indicating whether to only return match spread statistics.

Value

Tibble containing each player's rank, name, total matches played, number of matches won, the match results spread (relative to player 1), the average match time, the number of games played, the number of games won, average point advantage in a won game, the average point difference in final scores, the number of tie-break wins, and the percentage of games that go to a tie-breaker.

Note

This function only returns data from players ranked in the most recent PSA rankings table for Men's and Women's singles competitions.

References

http://www.squashinfo.com/rankings/men
http://www.squashinfo.com/rankings/women

Examples


## Get tidy matchup data for Mohamed Elshorbagy vs Ali Farag
get_matchup(player_1 = "Mohamed Elshorbagy",
                      player_2 = "Ali Farag",
                      category = "mens",
                      tidy = TRUE)

## Get non-tidy matchup data for Nouran Gohar vs Nour El Sherbini
get_matchup("Nouran Gohar", "Nour El Sherbini", category = "womens", tidy = FALSE)

## Get tidy match spread data for Paul Coll and Ali Farag
get_matchup("Paul Coll", "Ali Farag", category = "mens", tidy = TRUE, match_spread = TRUE)



squashinformr documentation built on May 10, 2022, 5:12 p.m.