NCAAbb | R Documentation |
Results of NCAA basketball games
Nine variables describing NCAA Division I basketball games.
date on which game was played
visiting team
visiting team's score
home team
home team's score
code indicting games played at neutral sites (n or N) or in tournaments (T)
where game was played
a character indicating which season the game belonged to
a logical indicating whether the game is a postseason game
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.