错误消息“输入必须是grobs!” (当组合不同的gbm图时)

时间:2015-10-14 20:38:17

标签: r gridextra gbm

我试图将来自不同gbm.plot.fit模型的plot.gbmgbm结合起来。这是我的示例代码:

#----------------------ask on stackexchange----------------------------#
mydata <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")

library(gbm)
library(dismo)

full.model<- gbm.step(data=mydata,gbm.x = 2:4,gbm.y = 1,family = "bernoulli", tree.complexity = 5,learning.rate = 0.005, bag.fraction = 0.5)

fit1 <- gbm.step(data=mydata,gbm.x = 2,gbm.y = 1,family = "bernoulli", tree.complexity = 5,learning.rate = 0.005, bag.fraction = 0.5)

a=gbm.plot.fits(full.model,v="gre")

b=plot.gbm(full.model,i.var="gre")

c=gbm.plot.fits(fit1)

d=plot.gbm(fit1)

grid.arrange(a, b, c, d, ncol=2, nrow =2)

错误消息是:

  

arrangeGrob(...,as.table = as.table,clip = clip,main = main,:     输入必须是grobs!

有人可以告诉我代码可能出错吗?

0 个答案:

没有答案