Learn R Programming

Lahman (version 1.0-7)

Salaries: Salaries table

Description

Player salary data.

Usage

data(Salaries)

Arguments

source

Lahman, S. (2010) Lahman's Baseball Database, 1871-2010, v.5.8, http://baseball1.com/statistics/

Details

There is no real coverage of player's salaries until 1985.

Examples

Run this code
# what years are included?
summary(Salaries$year)
# how many players included each year?
table(Salaries$year)

# add salary to Batting data
batting <- merge(Batting, 
                 Salaries[,c("playerID", "yearID", "teamID", "salary")], 
                 by=c("playerID", "yearID", "teamID"), all.x=TRUE)
str(batting)

Run the code above in your browser using DataLab