AwardsSharePlayers: AwardsSharePlayers table

Description Usage Format Source Examples

Description

Award voting for managers awards

Usage

1

Format

A data frame with 6617 observations on the following 7 variables.

awardID

name of award votes were received for

yearID

Year

lgID

League; a factor with levels AL ML NL

playerID

Player ID code

pointsWon

Number of points received

pointsMax

Maximum numner of points possible

votesFirst

Number of first place votes

Source

Lahman, S. (2014) Lahman's Baseball Database, 1871-2013, 2014 version, http://baseball1.com/statistics/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Vote tallies for post-season player awards

require(plyr)

# Which awards are represented in this data frame?
unique(AwardsSharePlayers$awardID)

# Sort the votes for the Cy Young award in decreasing order.
# For the first few years, the award went to the best pitcher
# in both leagues.

cyvotes <- ddply(subset(AwardsSharePlayers, awardID == "Cy Young"),
                 .(yearID, lgID), arrange, desc(pointsWon))

# 2012 votes
subset(cyvotes, yearID == 2012)

# top three votegetters each year by league

cya_top3 <- ddply(cyvotes, .(yearID, lgID), function(d) head(d, 3))

# unanimous Cy Young winners
subset(cyvotes, pointsWon == pointsMax)

# Top five pitchers with most top 3 vote tallies in CYA
head(with(cya_top3, rev(sort(table(playerID)))), 5)

# Ditto for MVP awards

MVP <- subset(AwardsSharePlayers, awardID == "MVP")
MVP_top3 <- ddply(MVP, .(yearID, lgID), 
                  function(d) head(arrange(d, desc(pointsWon)), 3))
head(with(MVP_top3, rev(sort(table(playerID)))), 5)

Lahman documentation built on May 2, 2019, 5:25 p.m.