SchoolsPlayers: SchoolsPlayers table

Description Usage Format Source Examples

Description

Information on schools players attended, by player

Usage

1

Format

A data frame with 6147 observations on the following 4 variables.

playerID

Player ID code

schoolID

school ID code

yearMin

year player's college career started

yearMax

year player's college career ended

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
data(SchoolsPlayers)
head(SchoolsPlayers)

## Q: What are the top universities for producing MLB players?
SPcount <- table(SchoolsPlayers$schoolID)
SPcount[SPcount>50]

library('lattice')
dotplot(SPcount[SPcount>50])
dotplot(sort(SPcount[SPcount>50]))

## Q: How many schools are represented in this dataset?
length(table(SchoolsPlayers$schoolID))

# Histogram of the number of players from each school who played in MLB:
with(SchoolsPlayers, hist(table(schoolID), xlab = 'Number of players',
                           main = ""))

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