field.goals: 2005 Field Goal Attempts

Description Usage Format Details Source Examples

Description

This data set contains information on all 982 field goal attempts during the 2005 NFL season.

Usage

1

Format

A data frame with 982 observations on the following 10 variables.

home.team

a factor representing the home team

week

a numeric vector representing the week of the season

qtr

a numeric vector representing the quarter during the game

away.team

a factor representing the away team

offense

a factor representing the offensive team

defense

a factor representing defensive team

play.type

a factor with levels FG aborted, FG blocked, FG good, and FG no

player

a factor representing player names

yards

a numeric vector

stadium.type

a factor with levels Both, In, and Out

Details

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.

Source

http://www.footballoutsiders.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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"
)

Example output

Loading required package: nutshell.bbdb
Loading required package: nutshell.audioscrobbler

nutshell documentation built on May 1, 2019, 10:08 p.m.