Description Usage Format Source Examples
Information on schools players attended, by player
1 |
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
Lahman, S. (2014) Lahman's Baseball Database, 1871-2013, 2014 version, http://baseball1.com/statistics/
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 = ""))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.