What are the packages required to plot a fancy Rpart plot in R

r
decision_trees

#1

While learning about decision tree I came to know, we can plot a fancy plot of a decision tree.But I want to what packages required to plot a fancy decision tree.

my tree

library(rpart)
str(train)
str(test)

my_tree_two <- rpart(Survived ~ Pclass+Sex+Age+SibSp+Parch+Fare+Embarked,data=train,method="class")

#2

hello @sid100158,

Agefit <- rpart(Age ~ Pclass + Sex + SibSp + Parch + Fare + Embarked + Title + FamilySize, 
                data=combi[!is.na(combi$Age),], method="anova")

#Normal plots:

    library(rpart.plot)
    rpart.plot(Agefit)

Colored plots:

library(RColorBrewer)
library(rattle)
fancyRpartPlot(Agefit)


#3

thanks shuvayan really helpful.