NFLTables Documentation
Enumerations
NFLTables.SeasonPart
— TypeParts of a single season
Examples
julia> PRE
PRE::SeasonPart = 0
julia> REG
REG::SeasonPart = 1
julia> POST
POST::SeasonPart = 2
Base.parse
— Methodparse(::Type{SeasonPart}, str::AbstractString)
Parse str
as a part of a season.
Examples
julia> parse(SeasonPart, "PRE")
PRE::SeasonPart = 0
julia> parse(SeasonPart, "REG")
REG::SeasonPart = 1
julia> parse(SeasonPart, "POST")
POST::SeasonPart = 2
NFLTables.SuperBowl
— TypeAn enumeration of the SuperBowls as stylized/marketed (with the season as the value)
Examples
julia> SuperBowl(2001)
SB_XXXVI::SuperBowl = 2001
julia> SuperBowl(2015)
SB_50::SuperBowl = 2015
NFL Schedule Data
NFLTables.Schedules.schedule
— Functionschedule(season::Integer)
Obtain the NFL schedule for season
Examples
julia> df = Schedules.schedule(2018);
julia> show(first(df[:, [:date, :home, :away, :homescore, :awayscore]], 5), eltypes=false)
5×5 DataFrame
Row │ date home away homescore awayscore
─────┼──────────────────────────────────────────────
1 │ 2018-08-02 BAL CHI 17 16
2 │ 2018-08-09 BAL LAR 33 7
3 │ 2018-08-09 BUF CAR 23 28
4 │ 2018-08-09 CIN CHI 30 27
5 │ 2018-08-09 GB TEN 31 17
nflscrapR Data
NFLTables.NFLScrapR.getplaydata
— Functiongetplaydata(season, part)
Create a dataframe of play-by-play data for part
of season
.
Examples
julia> df = NFLScrapR.getplaydata(2019, "POST");
julia> show(first(df[:, [:game_id, :home_team, :away_team, :yardline_100, :half_seconds_remaining]], 5), eltypes=false)
5×5 DataFrame
Row │ game_id home_team away_team yardline_100 half_seconds_remaining
─────┼────────────────────────────────────────────────────────────────────────
1 │ 2020012600 APR NPR 75 1800
2 │ 2020012600 APR NPR 75 1776
3 │ 2020012600 APR NPR 80 1757
4 │ 2020012600 APR NPR 71 1715
5 │ 2020012600 APR NPR 71 1709
NFLTables.NFLScrapR.getgamedata
— Functiongetgamedata(season, part)
Create a dataframe of game data for part
of season
.
Examples
julia> df = NFLScrapR.getgamedata(2019, "POST");
julia> show(first(df[:, [:game_id, :home_team, :away_team, :home_score, :away_score]], 5), eltypes=false)
5×5 DataFrame
Row │ game_id home_team away_team home_score away_score
─────┼──────────────────────────────────────────────────────────
1 │ 2020012600 APR NPR missing missing
2 │ 2020010400 HOU BUF 22 19
3 │ 2020010401 NE TEN 13 20
4 │ 2020010500 NO MIN 20 26
5 │ 2020010501 PHI SEA 9 17
nflfastR Data
NFLTables.NFLFastR.getdata
— Functiongetdata(season::Integer)
getdata(label::Symbol)
Create a dataframe of play-by-play data for season
or label
data for all seasons`.
Examples
julia> df = NFLFastR.getdata(2010);
julia> show(first(df[:, [:home_team, :away_team, :yardline_100, :half_seconds_remaining]], 5), eltypes=false)
5×4 DataFrame
Row │ home_team away_team yardline_100 half_seconds_remaining
─────┼────────────────────────────────────────────────────────────
1 │ LA ARI missing 1800
2 │ LA ARI 30 1800
3 │ LA ARI 78 1795
4 │ LA ARI 78 1764
5 │ LA ARI 73 1723