get_gw_data: Function to extract data for a specific player(s) from a...

View source: R/get_gw_data.R

get_gw_dataR Documentation

Function to extract data for a specific player(s) from a certain gameweek or weeks.

Description

Function to extract data for a specific player(s) from a certain gameweek or weeks.

Usage

get_gw_data(players, gw = 1:38)

Arguments

players

a vector of players, referred to either using their ID's (numerical vector) or names (character vector). as they are written in the id_lookup data frame. I would reccomend using the players ID's due to potential issues with special characters.

gw

The FPL Gameweek to pull data for, a vector of integers between 1 and 38. Note that if gameweeks chosen haven't been played yet then data won't be displayed for them. Defaults to all gameweeks.

Value

A data frame, with one row of data for each chosen player for each chosen gameweek. The data has 29 variables:

name

Player name

opponent

Team played against in this round

total_points

Total fpl points earned in this gameweek

was_home

Boolean - did the player play at home?

team_h_score, team_a_score

Number of goals scored by the home or away team

round

The Gameweek

minutes

Minutes played by the player in this gameweek

goals_scored, assists, clean_sheets, goals_conceded, own_goals, penalties_saved, penalties_missed, yellow_cards, red_cards, saves

Statistics related to the players performance in this gameweek

bonus

fpl bonus points awarded to the player in this gameweek

bps

Points allocated to the player by the fpl bonus points system - used to determine how many bonus point player should be awarded

influence, creativity,threat, ict_index

Values calculated by fpl algorithms

value

The cost of the player in this gameweek (£m)

transfers_balance, transfers_in, transfers_out

Figures relating to how many managers transferred this player in/out for this gameweek

selected

Number of fpl managers selected by

Examples

 # Not run since it's hard to pick a player who'll be around
 # forever
 # get_gw_data('Simon Mignolet')

 # get_gw_data(190, 1:2)

 # get_gw_data(1:10, 3)

 # get_gw_data(c('Simon Mignolet', 'Laurent Koscielny'))

jtalboys/fplR documentation built on July 31, 2022, 11:35 p.m.