Learn R Programming

nflscrapR (version 1.8.3)

get_season_rosters: Get team roster for a single season

Description

Given a year and team abbreviation, return a dataset with each player who has played the specified team and has recorded a measurable statistic.

Usage

get_season_rosters(season, teams, type = "reg", positions = c("QUARTERBACK",
  "RUNNING_BACK", "WIDE_RECEIVER", "TIGHT_END"))

Arguments

season

A 4-digit year associated with a given NFL season

teams

A string vector containing the abbreviations for NFL Team(s)

type

String indicating the type of game, must either be: "pre", "reg", or "post".

positions

A string vector containing the abbreviations for NFL position(s). Can be any of the following:

  • "QUARTERBACK" (in the default list)

  • "RUNNING_BACK" (in the default list)

  • "WIDE_RECEIVER" (in the default list)

  • "TIGHT_END" (in the default list)

  • "DEFENSIVE_LINEMAN"

  • "LINEBACKER"

  • "DEFENSIVE_BACK"

  • "KICKOFF_KICKER"

  • "KICK_RETURNER"

  • "PUNTER"

  • "PUNT_RETURNER"

  • "FIELD_GOAL_KICKER"

Value

A dataset with columns associated with season/year, full player name, team initial, position, and formated player name.

Details

To find team associated abbrevations use the nflteams dataset stored in this package!

Examples

Run this code
# NOT RUN {
# Roster for Steelers in 2018
get_season_rosters(2018, teams = "PIT") 
# }

Run the code above in your browser using DataLab