Skip to contents

Get Park Effects for NCAA Baseball Teams

Usage

ncaa_park_factor(teamid, years, type = "conference")

Arguments

teamid

The team's unique NCAA id.

years

The season or seasons (i.e. use 2016 for the 2015-2016 season, etc., limited to just 2013-2020 seasons).

type

default is conference. the conference parameter adjusts for the conference the school plays in, the division parameter calculates based on the division the school plays in 1,2,or 3. Defaults to 'conference'.

Value

A data frame with the following fields: school, home_game, away_game, runs_scored_home, runs_allowed_home, run_scored_away, runs_allowed_away, base_pf (base park factor), home_game_adj (an adjustment for the percentage of home games played) final_pf (park factor after adjustments)

col_nametypes
schoolcharacter
home_gamenumeric
away_gamenumeric
runs_scored_homenumeric
runs_allowed_homenumeric
runs_scored_awaynumeric
runs_allowed_awaynumeric
base_pfnumeric
home_game_adjnumeric
final_pfnumeric

Examples

# \donttest{
  try(ncaa_park_factor(teamid = 736, years = c(2017:2019), type = "conference"))
#>      school home_game away_game runs_scored_home runs_allowed_home
#>  Vanderbilt       104        91              782               125
#>  runs_scored_away runs_allowed_away base_pf home_game_adj final_pf
#>               591               166   1.045         1.021    1.017
# }