I am following Titanic Tutorial on DataCamp. After built the decision tree, the plotting for the decision tree just doesn't work, showing an error that
there is no package called ‘rpart.plot’
Any idea how to fix this?
libraries
library(rattle)
library(rpart)
library(RColorBrewer)
decision tree
my_tree_two <- rpart(Survived ~ Pclass + Sex + Age + SibSp + Parch + Fare + Embarked,
data = train,
method = 'class')
fancyRpartPlot(my_tree_two)
Please try installing "rpart.plot":
library("rpart.plot")