Learn R Programming

fastR2 (version 1.2.4)

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

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