library(knitr)

knitr::opts_chunk$set(
  warning = FALSE,
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/",
  out.width = "100%"
)

squashinformr

Lifecycle: experimental CRAN status CRAN Downloads CRAN total

R build status Codecov test coverage CodeFactor Tutorial

Overview

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.

Installation

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")

Usage

There are three major families of scraping functions in squashinformr:

Examples

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)

Help

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.

Disclaimer

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.

Author

This package was authored by Hayden MacDonald. Feel free to email me at hmd[at]needleinthehay.ca.

License

The squashinformr package is released under a GPL-3 license.



HaydenMacDonald/squashinformr documentation built on May 11, 2022, 4:59 a.m.