Search code examples
rmacosdecision-treerpartrattle

there is no package called ‘rpart.plot’


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)

Solution

  • Datacamp's Interpreter at times it is buggy and doesn't behaves as expected. If the package isn't available, you won't be able to install it.

    Consider reporting it to Datacamp