简体   繁体   English

是否可以在 R 中“镜像”使用 rpart.plot 生成的决策树的外观?

[英]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.我用rpart生成了一个简单的决定,并用rpart.plot显示它,如下所示。

决策树

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%)

Solved my own problem.解决了我自己的问题。 Adding the parameter xflip=TRUE to rpart.plot function flips the tree horizontally like intended将参数xflip=TRUE添加到rpart.plot function 会按预期水平翻转树

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM