there is no package called ‘rpart.plot’

xmindata picture xmindata · Jan 8, 2017 · Viewed 14.9k times · Source

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)

Answer

bhanu pratap singh sikarwar picture bhanu pratap singh sikarwar · Mar 15, 2017

Please try installing "rpart.plot":

library("rpart.plot")