我试图通过下面的代码找到一种方法来保存为pdf后在fancyRpartPlot后面出现的图像输出来绘制回归树。 任何人都知道我该怎么做?我无法通过网络找到任何答案。保存一个fancyRpartPlot为pdf
regression_tree <- data.frame(stock_mag = as.numeric(resData$stock_mag),
LT = as.numeric(resData$Lead_Time),
dmIn = as.numeric(resData$Intermittency),
dmCv = as.numeric(resData$CoV))
fit<-rpart(stock_mag~dmCv+dmIn+LT,data=regression_tree, method="anova", control=rpart.control(minsplit=20))
x11()
fancyRpartPlot(fit, main="test") # Will plot the tree#
谢谢!!
欢迎SO!请习惯于提供像这里描述的可重现的例子:http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – lukeA