Learn R Programming

squashinformr (version 0.2.6)

get_matchup: 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.

References

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

Examples

Run this code
# NOT RUN {
## Get tidy matchup data for Mohamed Elshorbagy vs Ali Farag
# }
# NOT RUN {
get_matchup(player_1 = "Mohamed Elshorbagy",
                      player_2 = "Ali Farag",
                      category = "mens",
                      tidy = TRUE)
# }
# NOT RUN {
## Get non-tidy matchup data for Nouran Gohar vs Nour El Sherbini
# }
# NOT RUN {
get_matchup("Nouran Gohar", "Nour El Sherbini", category = "womens", tidy = FALSE)
# }
# NOT RUN {
## Get tidy match spread data for Paul Coll and Ali Farag
# }
# NOT RUN {
get_matchup("Paul Coll", "Ali Farag", category = "mens", tidy = TRUE, match_spread = TRUE)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab