Code Monkey home page Code Monkey logo

footballr's Introduction

footballR

footballR is an R package that calls various free football (soccer) APIs.

There's quite a few good free resources for football data out there. Some detailed historical data taken is available from the openfootball and the jokecamp github pages. You can read a detailed review of all football data sources and API services here.

Getting Started

Install

Install from GitLab

# install.packages("devtools")
devtools::install_git("https://gitlab.com/dashee87/footballR.git")
library("footballR")

You can install from GitHub (identical mirror of GitLab)

# install.packages("devtools")
devtools::install_github("dashee87/footballR")
library("footballR")

Alternatively, you can copy the R files onto your computer and run them all locally (only if the other approaches fail for some reason).

Required Packages

The package relies on httr and jsonlite. The former handles calls to the API, while the latter converts the call output from JSON to data frames. These should be installed automatically with the package.

Tutorial

A short tutorial on how to use the football-data.org API is available here.

Status

This package is under active development and is subject to regular updates.

Currently, the package only supports calls to the football-data.org API.

Issues

Please let me know if something's not working.

Submit issues here.

Future

Links

Disclaimer

The footballR package is provided with absolutely no warranty.

footballr's People

Contributors

dashee87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

footballr's Issues

About footballR api v1 and api v2

After I finished installing footballR, I tried to run :
fdo_listCompTeams("436",response = "minified")

and I got a message:
"v1 has reached it's EOL. Please migrate to v2."

How can I fix this?

v2 update

Hi,

The football-data api has been updated to v2. Do you think you will be updating this package to interface with it?

Error: Failed to install 'unknown package' from Git: Error in 'git2r_remote_ls'

I get said error when I try to install the footballR package via:
devtools::install_git("https://gitlab.com/dashee87/footballR.git")

Error: Failed to install 'unknown package' from Git:
Error in 'git2r_remote_ls'

This is my session info:

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] here_0.1 forcats_0.4.0 stringr_1.4.0 dplyr_0.8.3 purrr_0.3.3 readr_1.3.1 tidyr_1.0.0 tibble_2.1.3
[9] ggplot2_3.2.1 tidyverse_1.2.1 abettor_0.1.5

loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 lubridate_1.7.4 lattice_0.20-38 prettyunits_1.0.2 ps_1.3.0 assertthat_0.2.1 zeallot_0.1.0
[8] rprojroot_1.3-2 digest_0.6.22 R6_2.4.0 cellranger_1.1.0 backports_1.1.5 evaluate_0.14 httr_1.4.1
[15] pillar_1.4.2 rlang_0.4.1 lazyeval_0.2.2 curl_4.2 readxl_1.3.1 rstudioapi_0.10 callr_3.3.2
[22] rmarkdown_1.16 desc_1.2.0 devtools_2.2.1 munsell_0.5.0 broom_0.5.2 compiler_3.5.3 modelr_0.1.5
[29] xfun_0.10 pkgconfig_2.0.3 pkgbuild_1.0.6 htmltools_0.4.0 tidyselect_0.2.5 crayon_1.3.4 withr_2.1.2
[36] grid_3.5.3 nlme_3.1-137 jsonlite_1.6 gtable_0.3.0 lifecycle_0.1.0 git2r_0.26.1 magrittr_1.5
[43] scales_1.0.0 cli_1.1.0 stringi_1.4.3 fs_1.3.1 remotes_2.1.0 testthat_2.2.1 xml2_1.2.2
[50] ellipsis_0.3.0 vctrs_0.2.0 generics_0.0.2 tools_3.5.3 glue_1.3.1 hms_0.5.2 rsconnect_0.8.15
[57] processx_3.4.1 pkgload_1.0.2 yaml_2.2.0 colorspace_1.4-1 sessioninfo_1.1.1 rvest_0.3.4 memoise_1.1.0
[64] knitr_1.25 haven_2.1.1 usethis_1.5.1 `

After loading the package successfully, the fotmob functions don't work

library(worldfootballR)
library(dplyr)
library(tidyr)

epl_team_xg_2021 <- fotmob_get_season_stats(
country = "ENG",
league_name = "Premier League",
season_name = "2020/2021",
stat_name = "Expected goals",
team_or_player = "team"
)

Error: Expected to find table or tables element but did not.
Error: Document is empty
In addition: Warning message:
Unknown or uninitialised column: page_url.

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.