Plot an rpart model and prettifies it. Wrap around the rpart.plot::prp function

rpart.plot_pretty(
  model,
  main = "",
  sub,
  caption,
  palettes,
  type = 2,
  fontfamily = "sans",
  ...
)

Arguments

model

an rpart model object

main

main title

sub

fixing captions in line

caption

character, caption to use in the plot

palettes

list, list of colours to use in the plot

type

type of plot. Default is 2. Possible values are: 0 Default. Draw a split label at each split and a node label at each leaf. 1 Label all nodes, not just leaves. 2 Like 1 but draw the split labels below the node labels. 3 Draw separate split labels for the left and right directions. 4 Like 3 but label all nodes, not just leaves. 5 Show the split variable name in the interior nodes.

fontfamily

Names of the font family to use for the text in the plots.

...

Additional arguments.

Value

An rpart.plot object. This plot object can be plotted using the rpart::prp function.