I want to plot a decision tree (as estimated by the partykit package) using the powerful ggparty package. Everything is fine except for the number of decimal places of numeric split variables. How can I format the breaks_label in geom_edge_label(), for example, to change > 75.33333 into > 75.3 in the plot below? round() does not work. I might use a workaround via the general options(digits = 3), but I am wondering whether there is a more direct way.
library("ggparty")
data("WeatherPlay", package = "partykit")
sp_o <- partysplit(1L, index = 1:3)
sp_h <- partysplit(3L, breaks = 75 + 1/3)
sp_w <- partysplit(4L, index = 1:2)
pn <- partynode(1L, split = sp_o, kids = list(
partynode(2L, split = sp_h, kids = list(
partynode(3L, info = "yes"),
partynode(4L, info = "no"))),
partynode(5L, info = "yes"),
partynode(6L, split = sp_w, kids = list(
partynode(7L, info = "yes"),
partynode(8L, info = "no")))))
py <- party(pn, WeatherPlay)
ggparty(py) +
geom_edge() +
# geom_edge_label() +
geom_edge_label(mapping = aes(label = paste(breaks_label))) +
geom_node_splitvar() +
geom_node_info()

Created on 2020-03-05 by the reprex package (v0.3.0)