Giter Club home page Giter Club logo

cran / itscalledsoccer Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 480 KB

:exclamation: This is a read-only mirror of the CRAN R package repository. itscalledsoccer — American Soccer Analysis API Client. Homepage: https://github.com/American-Soccer-Analysis/itscalledsoccer-r, https://american-soccer-analysis.github.io/itscalledsoccer-r/ Report bugs for this package: https://github.com/Amer ...

License: Other

R 100.00%

itscalledsoccer's Introduction

itscalledsoccer

CRAN status R-CMD-check Codecov test coverage

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
  • MLS NEXT Pro
  • North American Soccer League (defunct)

Installation

# 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.

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.

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. A few examples are below.

# Get all players named "Dax"
asa_players <- asa_client$get_players(names = "Dax")

# Get season-by-season xG data for all players named "Dax"
asa_xgoals <- asa_client$get_player_xgoals(
    leagues = "mls",
    player_names = "Dax",
    split_by_seasons = TRUE
)

# Get cumulative xPass data for all USL League One teams
asa_xpass <- asa_client$get_team_xpass(
    leagues = "usl1"
)

# Get game-by-game goals added (g+) data for all goalkeepers named "Matt Turner"
asa_goals_added <- asa_client$get_goalkeeper_goals_added(
    leagues = c("mls", "uslc"),
    player_names = "Matt Turner",
    split_by_game = TRUE
)

itscalledsoccer's People

Contributors

tyler-richardett avatar

Watchers

Gábor Csárdi avatar CRAN robot avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.