Learn R Programming

Lahman (version 1.0-8)

AwardsPlayers: AwardsPlayers table

Description

Award information for players awards

Usage

data(AwardsPlayers)

Arguments

source

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

Examples

Run this code
data(AwardsPlayers)
# Which awards have been given and how many?
with(AwardsPlayers, table(awardID))
awardtab <- with(AwardsPlayers, table(awardID))
library('lattice')
dotplot(awardtab)

# Restrict to MVP awards
mvp <- subset(AwardsPlayers, awardID == 'MVP')
# Who won in 1994?
mvp[mvp$yearID == 1994L, ]

goldglove <- subset(AwardsPlayers, awardID == 'Gold Glove')
# which players won most often?
GGcount <- table(goldglove$playerID)
GGcount[GGcount>10]

Run the code above in your browser using DataLab