如何在R Markdown中水平绘制决策树?

时间:2018-05-30 10:29:34

标签: r r-markdown rpart mlr

在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
```

我如何将其水平??

1 个答案:

答案 0 :(得分:1)

您是否尝试过设置fig.height和fig.width,例如{r ggpair, echo=FALSE, message = FALSE, warning = FALSE, fig.height = 12, fig.width = 12}