library(knitr) knitr::opts_chunk$set( warning = FALSE, collapse = TRUE, comment = "#>", fig.path = "man/figures/", out.width = "100%" )
squashinformr allows users to easily scrape SquashInfo for data on the Professional Squash Association World Tour and other squash tournaments. The functions within this package scrape, parse, and clean data associated with players, tournaments, and rankings.
Install squashinformr
via CRAN:
install.packages("squashinformr")
Install the development version of squashinformr
from this GitHub repository via:
if (!require("remotes")) install.packages("remotes") remotes::install_github("HaydenMacDonald/squashinformr")
There are three major families of scraping functions in squashinformr
:
get_players()
get_player_recent_results()
get_player_recent_matches()
get_player_recent_games()
get_matchup()
get_tournaments()
get_tournament_players()
get_tournament_matches()
get_tournament_games()
get_rankings()
get_player_recent_matches()
This function returns a player's recent matches.
library(squashinformr) ## Get Mohamed Elshorbagy's most recent match data get_player_recent_matches(player = "Mohamed Elshorbagy", category = "mens")
get_tournament_games()
This function returns a tournament's game results data.
## Return game data for 2020's Black Ball Open. get_tournament_games("Black Ball Open", year = 2020, world_tour = TRUE)
get_rankings()
This function returns data from the most recent PSA rankings tables.
library(dplyr) ## Get the top 5 players in both men's and women's singles competitions get_rankings(top = 5, category = "both") %>% arrange(category, rank)
get_matchup()
This function returns recent head-to-head matchup stats between two players. Stats returned include:
## Get tidy matchup stats for Paul Coll vs Fares Dessouky get_matchup("Paul Coll", "Fares Dessouky", category = "mens", tidy = FALSE)
Submit issues here on GitHub.
If you are interested in extending the functionality of this package, fork this repository, make your changes and submit them as a pull request. The squashinformr
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to its terms.
SquashInfo is a valuable resource for the international squash community. By creating and sharing this package, I do not intend to compete with SquashInfo or any of its stakeholders. The squashinformr
package was created to allow individuals to access data from SquashInfo in an efficient and responsible way, using polite
principles. Following polite
principles incurs mandatory delays on the scraping process set by SquashInfo. This prevents the use of this package from incurring unnecessary harm to SquashInfo servers via overwhelming requests. Therefore, it is important that users are patient when using this package. SquashInfo currently offers full access to their data and extra features through a premium membership. Please consider signing up and subscribing to SquashInfo to support their work.
This package was authored by Hayden MacDonald. Feel free to email me at hmd[at]needleinthehay.ca.
The squashinformr
package is released under a GPL-3 license.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.