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.nflschedule
— Functionnflschedule(season::Integer; redownload::Bool=false)
Obtain the NFL schedule for season
(optionally force a redownload
)
Examples
julia> df = nflschedule(2001);
julia> df[end-1, [:home, :homescore, :away, :awayscore]]
DataFrameRow
│ Row │ home │ homescore │ away │ awayscore │
│ │ String │ Int64 │ String │ Int64 │
├─────┼────────┼───────────┼────────┼───────────┤
│ 322 │ NE │ 20 │ STL │ 17 │
nflscrapR Data
NFLTables.nflscrapRplaybyplay
— FunctionnflscrapRplaybyplay(season::Integer, part::SeasonPart)
Create a dataframe of play-by-play data for part
of season
.
Examples
julia> df = nflscrapRplaybyplay(2018, POST);
julia> first(df, 5)
5×256 DataFrames.DataFrame. Omitted printing of 244 columns
│ Row │ play_id │ game_id │ home_team │ away_team │ posteam │ posteam_type │ defteam │ side_of_field │ yardline_100 │ game_date │ quarter_seconds_remaining │ half_seconds_remaining │
│ │ Int64 │ Int64 │ String │ String │ String⍰ │ String⍰ │ String⍰ │ String │ Int64⍰ │ Dates.Date │ Int64 │ Int64 │
├─────┼─────────┼────────────┼───────────┼───────────┼─────────┼──────────────┼─────────┼───────────────┼──────────────┼────────────┼───────────────────────────┼────────────────────────┤
│ 1 │ 36 │ 2019010500 │ HOU │ IND │ IND │ away │ HOU │ HOU │ 35 │ 2019-01-05 │ 900 │ 1800 │
│ 2 │ 51 │ 2019010500 │ HOU │ IND │ IND │ away │ HOU │ IND │ 75 │ 2019-01-05 │ 900 │ 1800 │
│ 3 │ 76 │ 2019010500 │ HOU │ IND │ IND │ away │ HOU │ IND │ 75 │ 2019-01-05 │ 860 │ 1760 │
│ 4 │ 98 │ 2019010500 │ HOU │ IND │ IND │ away │ HOU │ IND │ 77 │ 2019-01-05 │ 814 │ 1714 │
│ 5 │ 123 │ 2019010500 │ HOU │ IND │ IND │ away │ HOU │ IND │ 65 │ 2019-01-05 │ 774 │ 1674 │
NFLTables.nflscrapRgame
— FunctionnflscrapRgame(season::Integer, part::SeasonPart)
Create a dataframe of game data for part
of season
.
Examples
julia> df = nflscrapRgame(2018, POST);
julia> df[end, [:game_id, :home_team, :home_score, :away_team, :away_score]]
DataFrameRow
│ Row │ game_id │ home_team │ home_score │ away_team │ away_score │
│ │ Int64 │ String │ Int64 │ String │ Int64 │
├─────┼────────────┼───────────┼────────────┼───────────┼────────────┤
│ 12 │ 2019020300 │ LA │ 3 │ NE │ 13 │