NCAAbb: NCAA Division I Basketball Results

NCAAbbR Documentation

NCAA Division I Basketball Results

Description

Results of NCAA basketball games

Format

Nine variables describing NCAA Division I basketball games.

date

date on which game was played

away

visiting team

ascore

visiting team's score

home

home team

hscore

home team's score

notes

code indicting games played at neutral sites (n or N) or in tournaments (T)

location

where game was played

season

a character indicating which season the game belonged to

postseason

a logical indicating whether the game is a postseason game

Source

https://kenpom.com

Examples


data(NCAAbb)
# select one year and add some additional variables to the data frame
NCAA2010 <-
  NCAAbb %>% 
  filter(season == "2009-10") %>%
  mutate(
    dscore = hscore - ascore,
    homeTeamWon = dscore > 0,
    numHomeTeamWon <- -1 + 2 * as.numeric(homeTeamWon),
    winner = ifelse(homeTeamWon, home, away),
    loser  = ifelse(homeTeamWon, away, home),
    wscore = ifelse(homeTeamWon, hscore, ascore),
    lscore = ifelse(homeTeamWon, ascore, hscore)
  )
NCAA2010 %>% select(date, winner, loser, wscore, lscore, dscore, homeTeamWon) %>% head()

fastR2 documentation built on Nov. 9, 2023, 9:06 a.m.