在 R Markdown 中,我想水平绘制决策树,以便它更适合整个 PDF 页面。此代码将其垂直绘制:
```{r, message=FALSE, warning = FALSE, echo=FALSE, cache = FALSE}
rpart.lrn <- makeLearner("classif.rpart", predict.type = "prob", fix.factors.prediction = FALSE)
model = train(rpart.lrn, task = classif.task, subset = train.set)
tree <- getLearnerModel(model)
rpart.plot(tree) # visualise the tree
```
如何水平绘制它?
最佳答案
你试过设置 fig.height 和 fig.width,例如 {r ggpair, echo=FALSE, message = FALSE, warning = FALSE, fig.height = 12, fig.width = 12}
关于r - 如何在 R Markdown 中水平绘制决策树?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50602385/