# NOT RUN {
# To obtain the entire dataset, run the following code:
library(dplyr)
library(tidyr)
library(readr)
library(janitor)
nba_carmelo <- read_csv("https://projects.fivethirtyeight.com/nba-model/nba_elo.csv") %>%
clean_names() %>%
mutate(
team1 = as.factor(team1),
team2 = as.factor(team2),
playoff = ifelse(playoff == "t", TRUE, FALSE),
playoff = ifelse(is.na(playoff), FALSE, TRUE),
neutral = ifelse(neutral == 1, TRUE, FALSE)
)
# }
Run the code above in your browser using DataLab