Search code examples
rmachine-learningrpart

Is it possible to "Mirror" the look of a decision tree generated with rpart.plot in R?


I have generated a simple decision with rpart and displayed it with rpart.plot like the following.

Decision Tree

Is it possible to edit the look of the tree so it's "mirrored" like the following:

         (e-100%)
____(yes)___|___(no)____
|                       |
|                     (e-53%)
(p-47%)               __|__
                     |     |
                  (p-1%)  (e-52%)


Solution

  • Adding the parameter xflip=TRUE to rpart.plot function flips the tree horizontally like intended