diff --git a/shiny/003-play-golf/app.R b/shiny/003-play-golf/app.R index 3715ade..289b39d 100644 --- a/shiny/003-play-golf/app.R +++ b/shiny/003-play-golf/app.R @@ -14,6 +14,8 @@ library(randomForest) # Read data weather <- read.csv(text = getURL("https://raw.githubusercontent.com/dataprofessor/data/master/weather-weka.csv") ) +weather$play = factor(weather$play) +weather$outlook = factor(weather$outlook) # Build model model <- randomForest(play ~ ., data = weather, ntree = 500, mtry = 4, importance = TRUE)