downloads

CRAN status

R-CMD-check

Installation

  • To install the latest version from GitHub, run:
devtools::install_github("andrewl776/FPLdata")
  • A near-latest version of {FPLdata} can be installed from CRAN by running:
install.packages("FPLdata")

Getting the data

  • The package can be loaded via:
library(FPLdata)
  • Finally, the latest data can be retrieved by calling the only function in the package:
fpl_data <- FPLdata()
## Rows: 38386 Columns: 94
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr   (7): web_name, first_name, news, photo, second_name, status, season
## dbl  (77): gameweek, event_points, next_gw_points, total_points, chance_of_p...
## lgl   (8): in_dreamteam, special, squad_number, corners_and_indirect_freekic...
## dttm  (2): news_added, correct_as_of_time
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
fpl_data
## # A tibble: 38,386 × 94
##    web_n…¹ gamew…² event…³ next_…⁴ total…⁵ chanc…⁶ chanc…⁷  code cost_…⁸ cost_…⁹
##    <chr>     <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl> <dbl>   <dbl>   <dbl>
##  1 Cédric        1       0       0       0      NA      NA 58822     0         0
##  2 Cédric        2       0       0       0      NA      NA 58822     0         0
##  3 Cédric        2       0       0       0      NA      NA 58822     0         0
##  4 Cédric        3       0       0       0      NA      NA 58822    -0.1       1
##  5 Cédric        3       0       0       0      NA      NA 58822    -0.1       1
##  6 Cédric        4       0       0       0      NA      NA 58822     0         0
##  7 Cédric        4       0       0       0      NA      NA 58822     0         0
##  8 Cédric        5       0      NA       0      NA      NA 58822     0         0
##  9 Cédric        5       0       0       0      NA      NA 58822     0         0
## 10 Cédric        6       0       0       0      NA      NA 58822     0         0
## # … with 38,376 more rows, 84 more variables: cost_change_start <dbl>,
## #   cost_change_start_fall <dbl>, dreamteam_count <dbl>, element_type <dbl>,
## #   ep_next <dbl>, ep_this <dbl>, first_name <chr>, form <dbl>,
## #   player_id <dbl>, in_dreamteam <lgl>, news <chr>, news_added <dttm>,
## #   now_cost <dbl>, photo <chr>, points_per_game <dbl>, second_name <chr>,
## #   selected_by_percent <dbl>, special <lgl>, squad_number <lgl>, status <chr>,
## #   team_code <dbl>, transfers_in <dbl>, transfers_in_event <dbl>, …