Learn R Programming

fastR2 (version 0.2.0)

NFL2007: NFL 2007 season

Description

Results of National Football League games (2007 season, including playoffs)

Arguments

Format

A data frame with 267 observations on the following 7 variables.

  • date date on which game was played

  • visitor visiting team

  • VisitorScore score for visiting team

  • Home home team

  • HomeScore score for home team

  • Line `betting line'

  • totalLine 'over/under' line (for combined score of both teams)

Examples

Run this code
# NOT RUN {
data(NFL2007) 
NFL <- NFL2007 
NFL$dscore <- NFL$homeScore - NFL$visitorScore 
w <- which(NFL$dscore > 0) 
NFL$winner <- NFL$visitor; NFL$winner[w] <- NFL$home[w] 
NFL$loser <- NFL$home; NFL$loser[w] <- NFL$visitor[w] 
# did the home team win? 
NFL$homeTeamWon <- NFL$dscore > 0 
table(NFL$homeTeamWon)
table(NFL$dscore > NFL$line)

# }

Run the code above in your browser using DataLab