xmindata
xmindata

Reputation: 105

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)

Upvotes: 1

Views: 26703

Answers (3)

Apocalypse How
Apocalypse How

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

Please try installing "rpart.plot":

library("rpart.plot")

Upvotes: 4

Pj_
Pj_

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

Related Questions