Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Schools

Schools table


Description

Information on schools players attended, by school

Usage

data(Schools)

Format

A data frame with 1207 observations on the following 5 variables.

schoolID

school ID code

name_full

school name

city

city where school is located

state

state where school's city is located

country

country where school is located

Source

Lahman, S. (2022) Lahman's Baseball Database, 1871-2021, 2021 version, https://www.seanlahman.com/baseball-archive/statistics/

Examples

require("dplyr")

# How many different schools are listed in each state?
table(Schools$state)
 
# How many different schools are listed in each country?
table(Schools$country)

# Top 20 schools 
schoolInfo <- Schools %>% select(-country)

schoolCount <- CollegePlaying %>%
                 group_by(schoolID) %>%
                 summarise(players = length(schoolID)) %>%
                 left_join(schoolInfo, by = "schoolID") %>%
                 arrange(desc(players)) 
head(schoolCount, 20)

# sum counts by state
schoolStates <- schoolCount %>%
                  group_by(state) %>%
                  summarise(players = sum(players),
                            schools = length(state))
str(schoolStates)
summary(schoolStates)

Lahman

Sean 'Lahman' Baseball Database

v10.0-1
GPL
Authors
Michael Friendly [aut], Chris Dalzell [cre, aut], Martin Monkman [aut], Dennis Murphy [aut], Vanessa Foot [ctb], Justeena Zaki-Azat [ctb], Sean Lahman [cph]
Initial release
2022-04-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.