Changing Label Positions in the R-Lot Area (Decision / Regression Trees)

The package partykitgives a good view of decision trees. The only problem I encounter is when the labels are long and then they overlap. Can these labels be moved to prevent this (see Blue arrows in the figure below)?

library("rpart")
library("partykit")
rp <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
party_rp <- as.party(rp)

plot(party_rp)

enter image description here

+4
source share
1 answer

edge_simple : "alternate" , "decreasing", "increasing" "equal". justmin, Inf (.. ). . ?edge_simple.

, "increasing" (.. justmin = 1):

plot(party_rp,
  ep_args = list(justmin = 1, just = "increasing"))

edge_simple

+2

Source: https://habr.com/ru/post/1683374/


All Articles