Description Usage Format Source Examples
Results of NCAA basketball games
1 2 3 4 5 |
Seven 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
1 2 3 4 5 6 7 8 9 10 11 12 | data(ncaa2010)
# add some additional variables to the data frame
ncaa2010$dscore <- ncaa2010$hscore- ncaa2010$ascore
ncaa2010$homeTeamWon <- ncaa2010$dscore > 0
ncaa2010$numHomeTeamWon <- -1 + 2 * as.numeric(ncaa2010$homeTeamWon)
w <- which(ncaa2010$homeTeamWon)
ncaa2010$winner <- as.character(ncaa2010$away)
ncaa2010$winner[w] <- as.character(ncaa2010$home)[w]
ncaa2010$loser <- as.character(ncaa2010$home)
ncaa2010$loser[w] <- as.character(ncaa2010$away)[w]
ncaa2010$homeTeamWon <- ncaa2010$winner == ncaa2010$home
ncaa2010$numHomeTeamWon <- -1 + 2 * as.numeric(ncaa2010$homeTeamWon)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.