Reputation: 105
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)
Upvotes: 1
Views: 26703
Reputation: 108
The rpart.plot package should first be installed, then loaded in order to be used.
install.packages("rpart.plot")
library(rpart.plot)
The package does not install when you install rplot and must be installed with the above commands.
Upvotes: 4
Reputation: 51
Please try installing "rpart.plot":
library("rpart.plot")
Upvotes: 4
Reputation: 824
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
Upvotes: 1