| AwardsShareManagers {Lahman} | R Documentation |
Award voting for managers awards
data(AwardsShareManagers)
A data frame with 372 observations on the following 7 variables.
awardIDname of award votes were received for
yearIDYear
lgIDLeague; a factor with levels AL NL
managerIDManager ID code
pointsWonNumber of points received
pointsMaxMaximum numner of points possible
votesFirstNumber of first place votes
Lahman, S. (2010) Lahman's Baseball Database, 1871-2012, 2012 version, http://baseball1.com/statistics/
# Voting for the BBWAA Manager of the Year award by year and league
require(plyr)
# Sort in decreasing order of points by year and league
MOYsort <- ddply(AwardsShareManagers, .(yearID, lgID), arrange, desc(pointsWon))
# Any unanimous winners?
subset(AwardsShareManagers, pointsWon == pointsMax)
## [1] awardID yearID lgID managerID pointsWon pointsMax
## [7] votesFirst
## <0 rows> (or 0-length row.names)
# OK, how about highest proportion of possible points?
AwardsShareManagers[with(AwardsShareManagers, which.max(pointsWon/pointsMax)), ]
## awardID yearID lgID managerID pointsWon pointsMax votesFirst
## 87 Mgr of the year 1991 AL kellyto01m 138 140 27
# Bobby Cox's MOY vote tallies
subset(AwardsShareManagers, managerID == "coxbo01m")
## awardID yearID lgID managerID pointsWon pointsMax votesFirst
## 2 Mgr of the year 1983 AL coxbo01m 4 28 4
## 9 Mgr of the year 1984 AL coxbo01m 9 140 0
## 17 Mgr of the year 1985 AL coxbo01m 104 140 16
## 95 Mgr of the year 1991 NL coxbo01m 96 120 13
## 105 Mgr of the year 1992 NL coxbo01m 29 120 1
## 120 Mgr of the year 1993 NL coxbo01m 27 140 0
## 132 Mgr of the year 1994 NL coxbo01m 3 140 0
## 147 Mgr of the year 1995 NL coxbo01m 20 140 1
## 163 Mgr of the year 1996 NL coxbo01m 24 140 3
## 174 Mgr of the year 1997 NL coxbo01m 6 140 0
## 189 Mgr of the year 1998 NL coxbo01m 17 160 0
## 198 Mgr of the year 1999 NL coxbo01m 98 160 10
## 214 Mgr of the year 2000 NL coxbo01m 41 160 1
## 228 Mgr of the Year 2001 NL coxbo01m 12 160 2
## 238 Mgr of the Year 2002 NL coxbo01m 93 160 9
## 253 Mgr of the Year 2003 NL coxbo01m 56 160 6
## 264 Mgr of the year 2004 NL coxbo01m 140 160 22
## 276 Mgr of the year 2005 NL coxbo01m 152 160 28
## 327 Mgr of the year 2009 NL coxbo01m 15 160 0
## 342 Mgr of the year 2010 NL coxbo01m 28 160 1