battingLabels {Lahman}R Documentation

Variable Labels

Description

These data frames provide descriptive labels for the variables in the Batting, Pitching and Fielding files (and related *Post files). They are useful for plots and other output using Label.

Usage

data(battingLabels)

data(fieldingLabels)

data(pitchingLabels)

Format

Each is data frame with observations on the following 2 variables.

variable

variable name

label

variable label

See Also

Label

Examples


data(battingLabels)
str(battingLabels)
## 'data.frame':    24 obs. of  2 variables:
##  $ variable: chr  "playerID" "yearID" "stint" "teamID" ...
##  $ label   : chr  "Player ID code" "Year" "Player's stint" "Team" ...

require(plyr)
# find and plot maximum number of homers per year
batHR <- ddply(subset(Batting, !is.na(HR)), .(yearID),
        summarise, max=max(HR))

with(batHR, {
  plot(yearID, max, 
       xlab=Label("yearID"), ylab=paste("Maximum", Label("HR")), 
       cex=0.8)
  lines(lowess(yearID, max), col="blue", lwd=2)
  abline(lm(max ~ yearID), col="red", lwd=2)
    })

plot of chunk unnamed-chunk-1



[Package Lahman version 2.0-1 Index]