Learn R Programming

squashinformr (version 0.2.6)

get_tournament_matches: Get a tournament's matches from SquashInfo

Description

Given a tournament name or a year, get_tournament_matches() returns match data for PSA World Tour tournaments and other events.

Usage

get_tournament_matches(tournament = NULL, year = NULL, world_tour = NULL)

Arguments

tournament

character string of name of the tournament. Partial tournament names are matched via regular expressions.

year

integer indicating year of competition. Must be 2021, 2022, or NULL if querying results for both years.

world_tour

logical indicating whether to only return PSA World Tour tournaments.

Value

Tibble containing the tournament name, competition category, tournament date, round, player 1, player 2, the match winner, games won (by player 1), games lost (by player 1), the match time, player 1's seed, player 2's seed, player 1's nationality, player 2's nationality.

References

http://www.squashinfo.com/results

Examples

Run this code
# NOT RUN {
## Return match data for 2022's Allam British Open.
# }
# NOT RUN {
get_tournament_matches("Allam British Open", year = 2022, world_tour = TRUE)
# }
# NOT RUN {
## Return match data for all PSA World Tour tournaments in 2022
# }
# NOT RUN {
get_tournament_matches(year = 2022, world_tour = TRUE)
# }
# NOT RUN {


# }

Run the code above in your browser using DataLab