field.goals {nutshell} | R Documentation |
This data set contains information on all 982 field goal attempts during the 2005 NFL season.
data(field.goals)
A data frame with 982 observations on the following 10 variables.
home.team
week
qtr
away.team
offense
defense
play.type
FG aborted
, FG blocked
, FG good
, and FG no
player
yards
stadium.type
Both
, In
, and Out
This data is provided courtesy of Aaron Schatz, Editor-in-Chief of Football Outsiders a web site about American Football.
This data set is used as an example in the book "R in a Nutshell" from O'Reilly Media.
http://www.footballoutsiders.com
data(field.goals) hist(field.goals$yards) field.goals.forlr <- transform(field.goals, good=as.factor(ifelse(play.type=="FG good","good","bad"))) field.goals.table <- table(field.goals.forlr$good, field.goals.forlr$yards) plot(colnames(field.goals.table), field.goals.table["good",] / (field.goals.table["bad",] + field.goals.table["good",]), xlab="Distance (Yards)", ylab="Percent Good" )