itscalledsoccer
R package that wraps the ASA API
https://github.com/american-soccer-analysis/itscalledsoccer-r
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (16.4%) to scientific vocabulary
Keywords
Repository
R package that wraps the ASA API
Basic Info
- Host: GitHub
- Owner: American-Soccer-Analysis
- License: other
- Language: R
- Default Branch: main
- Homepage: https://american-soccer-analysis.github.io/itscalledsoccer-r/
- Size: 6.2 MB
Statistics
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 2
- Releases: 8
Topics
Metadata Files
README.md
itscalledsoccer 
Overview
itscalledsoccer is a wrapper around the same API that powers the American Soccer Analysis app. It enables R users to programmatically retrieve advanced analytics for their favorite players and teams, with coverage of the following competitions:
- Major League Soccer
- National Women's Soccer League
- USL Championship
- USL League One
- USL Super League
- MLS NEXT Pro
- North American Soccer League (defunct)
Installation
```r
Install release version from CRAN
install.packages("itscalledsoccer")
Install development version from GitHub
devtools::install_github("American-Soccer-Analysis/itscalledsoccer-r") ```
Getting Started
Initialize the main class with the new method.
r
asa_client <- AmericanSoccerAnalysis$new()
If you're in an environment where a proxy server is required, or if you need to need to alter any other CURL options, you can pass any number of httr configs when initializing the class. Use these at your own discretion.
r
asa_client <- AmericanSoccerAnalysis$new(
httr::config(ssl_verifypeer = 0L),
httr::use_proxy("64.251.21.73", 8080)
)
Usage
Any of the get_* methods can be used to retrieve the same data made available in the American Soccer Analysis app. Partial matches or abbreviations are accepted for any player or team names. For most methods, arguments must be named. Additionally, dataframes of complete players, teams, games, and more are also available for joining additional information. A variety of examples are below, and full documentation can be found here.
```r
Initialize the main class
asa_client <- AmericanSoccerAnalysis$new() ```
```r
Access dataframes of games, players, teams, and more from the ASA client object created above
allgames <- asaclient$games allteams <- asaclient$teams allplayers <- asaclient$players
see league options
asa_client$LEAGUES ```
```r
Get all players named "Dax"
daxplayers <- asaclient$get_players(names = "Dax") ```
```r
Get cumulative player shot information (i.e., xgoals) from the NWSL over three seasons
see other parameters in package documentation
asaxgoals <- asaclient$getplayerxgoals( leagues = "nwsl", seasonname = c(2021:2023), splitbyseasons = FALSE) head(shotsdf) ```
```r
Get season-by-season shot information (i.e., xgoals) for all players named "Dax" in MLS
asaxgoals <- asaclient$getplayerxgoals( leagues = "mls", playernames = "Dax", splitby_seasons = TRUE )
Join player names
library(dplyr) asaxgoals <- asaxgoals %>% leftjoin(allplayers, by = "player_id") ```
```r
Get player passing information (i.e., xpass) from MLS in 2023
asaxpass <- asaclient$getplayerxpass( leagues = "mls", season_name = 2023)
Get cumulative/career xPass data for all USL League One teams
asaxpass <- asaclient$getteamxpass( leagues = "usl1" ) ```
```r
Get team g+ information (i.e., goals added) from MLS
library(tidyr)
tall version
asagoalsadded <- asaclient$getteamgoalsadded( leagues = "mls", season_name = 2023) %>% tidyr::unnest(data)
wide version
asagoalsadded <- asaclient$getteamgoalsadded( leagues = "mls", seasonname = 2023) %>% tidyr::unnest(data) %>% tidyr::pivotwider( idcols = teamid, namesfrom = actiontype, valuesfrom = c(numactionsfor:goalsadded_against))
Get game-by-game goals added (g+) data for all goalkeepers named "Matt Turner"
asagoalsadded <- asaclient$getgoalkeepergoalsadded( leagues = c("mls", "uslc"), playernames = "Matt Turner", splitby_game = TRUE ) ```
Owner
- Name: American Soccer Analysis
- Login: American-Soccer-Analysis
- Kind: organization
- Website: https://www.americansocceranalysis.com/
- Twitter: AnalysisEvolved
- Repositories: 5
- Profile: https://github.com/American-Soccer-Analysis
Solving soccer
GitHub Events
Total
- Create event: 4
- Issues event: 2
- Release event: 2
- Watch event: 2
- Delete event: 1
- Issue comment event: 1
- Push event: 15
- Pull request review comment event: 4
- Pull request review event: 12
- Pull request event: 6
- Fork event: 1
Last Year
- Create event: 4
- Issues event: 2
- Release event: 2
- Watch event: 2
- Delete event: 1
- Issue comment event: 1
- Push event: 15
- Pull request review comment event: 4
- Pull request review event: 12
- Pull request event: 6
- Fork event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Tyler Richardett | t****t@g****m | 72 |
| bgrnwd | 1****d | 2 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 10
- Total pull requests: 21
- Average time to close issues: 9 days
- Average time to close pull requests: 8 days
- Total issue authors: 3
- Total pull request authors: 6
- Average comments per issue: 0.2
- Average comments per pull request: 0.33
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 9
- Average time to close issues: 4 days
- Average time to close pull requests: 15 days
- Issue authors: 1
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.33
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- bgrnwd (4)
- tyler-richardett (4)
- mattyanselmo (2)
Pull Request Authors
- tyler-richardett (11)
- akeaswaran (6)
- mattyanselmo (2)
- lvanden (2)
- olivroy (2)
- bgrnwd (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 453 last-month
- Total docker downloads: 41,971
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 9
- Total maintainers: 1
cran.r-project.org: itscalledsoccer
American Soccer Analysis API Client
- Homepage: https://github.com/American-Soccer-Analysis/itscalledsoccer-r
- Documentation: http://cran.r-project.org/web/packages/itscalledsoccer/itscalledsoccer.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.2
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.2.0 depends
- R6 >= 2.5.0 imports
- clisymbols * imports
- crayon * imports
- data.table >= 1.13.0 imports
- dplyr >= 1.0.0 imports
- glue >= 1.4.1 imports
- httpcache >= 1.2.0 imports
- httr >= 1.4.2 imports
- jsonlite >= 1.7.0 imports
- magrittr >= 2.0.0 imports
- rlang >= 0.4.10 imports
- stringi >= 1.5.3 imports
- tidyr >= 1.1.1 imports
- covr * suggests
- testthat >= 3.0.0 suggests
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite