Learn R Programming

nflfastR (version 3.2.0)

fast_scraper_roster: Get team rosters for multiple seasons

Description

Given years return a dataset with each player listed as part of the roster.

Usage

fast_scraper_roster(seasons, pp = FALSE)

Arguments

seasons

A vector of 4-digit years associated with given NFL seasons

pp

Logical - either TRUE or FALSE (see details for further information)

Value

Data frame where each individual row represents a player in the roster of the given team and season containing the following information:

season

4 digit season year.

team

Team abbreviation.

position

Abbreviation of the player's position (e.g. "QB", "WR", "RB", "CB"...).

depth_chart_position

Starting with the 2020 season: the abbreviation of the players depth_chart_position.

jersey_number

The player's 2 digit jersey number.

status

String indicating the status of the player (e.g. "Active", "Inactive", "Injured Reserve"...) at the update time update_dt (see below)

full_name

Full name of the player.

first_name

First name of the player.

last_name

Last name of the player.

birth_date

Birth date of the player.

height

Height of the player.

weight

Weight of the player.

college

Name of the college the player has attended.

high_school

Name of the High School the player has attended (only non-NA for players who were listed in the 2020 season).

gsis_id

The player's NFL GSIS ID, which can be used to link the player to play-by-play data.

espn_id

The player's ESPN ID (only non-NA for players who were listed in the 2020 season).

sportradar_id

The player's Sportradar ID (only non-NA for players who were listed in the 2020 season).

yahoo_id

The player's Yahoo Sports ID (only non-NA for players who were listed in the 2020 season).

rotowire_id

The player's Rotowire ID (only non-NA for players who were listed in the 2020 season).

update_dt

Date and time when the current entry was last updated (starting with the 2020 season).

headshot_url

URL to a player image (starting in the 2020 season on ESPN servers).

Details

The roster data is accessed via the free to use Sleeper API. The pp parameter controls if the scraper should use parallel processing. Please note that the initiating process takes a few seconds which means it may be better to set pp = FALSE if you are scraping just a few seasons.

Examples

Run this code
# NOT RUN {
# Roster of the 2019 and 2020 seasons
fast_scraper_roster(2019:2020)
# }

Run the code above in your browser using DataLab