Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R:Plotlearner的多点打印器在RStudio中打印MLR发射错误的对象_R_Ggplot2_Runtime Error_Rstudio_Mlr - Fatal编程技术网

R:Plotlearner的多点打印器在RStudio中打印MLR发射错误的对象

R:Plotlearner的多点打印器在RStudio中打印MLR发射错误的对象,r,ggplot2,runtime-error,rstudio,mlr,R,Ggplot2,Runtime Error,Rstudio,Mlr,本文演示了MLR包。plotLearnerPrediction函数通过返回ggplot对象。我尝试了下面为ggplot2对象提供的multiplot函数,但我的RStudio崩溃了。我能在没有RStudio的情况下策划事情 所以 如何在RStudio中在同一张图片中并排打印多个plotLearnerPrediction对象? library(mlr) # Multiple plot function here failing with p1,p2,p3,... in RStudio # bu

本文演示了MLR包。plotLearnerPrediction函数通过返回ggplot对象。我尝试了下面为ggplot2对象提供的multiplot函数,但我的RStudio崩溃了。我能在没有RStudio的情况下策划事情

所以

如何在RStudio中在同一张图片中并排打印多个plotLearnerPrediction对象?

library(mlr)

# Multiple plot function here failing with p1,p2,p3,... in RStudio
# but I am able to run this thing without RStudio.
# http://www.cookbook-r.com/Graphs/Multiple_graphs_on_one_page_(ggplot2)/

learners = list( makeLearner("classif.svm", kernel = "linear"), 
                 makeLearner("classif.svm", kernel = "polynomial"), 
                 makeLearner("classif.svm", kernel = "radial"), 
                 "classif.qda", 
                 "classif.randomForest", 
                 "classif.knn" )

p1<-plotLearnerPrediction(learner = learners[[1]], task = iris.task)
p2<-plotLearnerPrediction(learner = learners[[2]], task = iris.task)
p3<-plotLearnerPrediction(learner = learners[[3]], task = iris.task)
p4<-plotLearnerPrediction(learner = learners[[4]], task = iris.task)
#p5<-plotLearnerPrediction(learner = learners[[5]], task = iris.task)
#p6<-plotLearnerPrediction(learner = learners[[6]], task = iris.task)

#multiplot(p1, p2, p3, p4, p5, p6, cols=2) #failing in Rstudio
#multiplot(p1, p2, p3, p4, cols=1) #failing in Rstudio but not without it
命令行上的R


您可以使用library
gridExtra

require(gridExtra)
图书馆(gridExtra)

p1我假设您是指定义的
multiplot
函数。你发布的代码对我来说很好。您是否尝试过github版本的
mlr
?@larskothoff devtools::install_github(“mlr org/mlr”)引发了许多错误。这些错误来自于
smote
包。你可以安装它的二进制版本或者升级你的GCC。好的,这是RStudio的问题。很高兴它在CRAN mlr版本中对您起作用。不,smote实际上与mlr一起提供——我的错。我不用RStudio,所以恐怕我帮不了你。
> version
               _                           
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          4.1                         
year           2017                        
month          06                          
day            30                          
svn rev        72865                       
language       R                           
version.string R version 3.4.1 (2017-06-30)
nickname       Single Candle               
$ R --version
R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)