Running examples in ‘biomod2-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: models_scores_graph
> ### Title: Produce models evaluation bi-dimensional graph
> ### Aliases: models_scores_graph
> ### Keywords: evaluation scores graph
> 
> ### ** Examples
> 
> ## this example is based on BIOMOD_Modeling function example
> example(BIOMOD_Modeling)

BIOMOD> # species occurrences
BIOMOD> DataSpecies <- read.csv(system.file("external/species/mammals_table.csv",
BIOMOD+                                     package="biomod2"))

BIOMOD> head(DataSpecies)
  X X_WGS84  Y_WGS84 ConnochaetesGnou GuloGulo PantheraOnca PteropusGiganteus
1 1   -94.5 82.00001                0        0            0                 0
2 2   -91.5 82.00001                0        1            0                 0
3 3   -88.5 82.00001                0        1            0                 0
4 4   -85.5 82.00001                0        1            0                 0
5 5   -82.5 82.00001                0        1            0                 0
6 6   -79.5 82.00001                0        1            0                 0
  TenrecEcaudatus VulpesVulpes
1               0            0
2               0            0
3               0            0
4               0            0
5               0            0
6               0            0

BIOMOD> # the name of studied species
BIOMOD> myRespName <- 'GuloGulo'

BIOMOD> # the presence/absences data for our species 
BIOMOD> myResp <- as.numeric(DataSpecies[,myRespName])

BIOMOD> # the XY coordinates of species data
BIOMOD> myRespXY <- DataSpecies[,c("X_WGS84","Y_WGS84")]

BIOMOD> # Environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
BIOMOD> myExpl = stack( system.file( "external/bioclim/current/bio3.grd", 
BIOMOD+                              package="biomod2"),
BIOMOD+                 system.file( "external/bioclim/current/bio4.grd", 
BIOMOD+                              package="biomod2"), 
BIOMOD+                 system.file( "external/bioclim/current/bio7.grd", 
BIOMOD+                              package="biomod2"),  
BIOMOD+                 system.file( "external/bioclim/current/bio11.grd", 
BIOMOD+                              package="biomod2"), 
BIOMOD+                 system.file( "external/bioclim/current/bio12.grd", 
BIOMOD+                              package="biomod2"))

BIOMOD> # 1. Formatting Data
BIOMOD> myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
BIOMOD+                                      expl.var = myExpl,
BIOMOD+                                      resp.xy = myRespXY,
BIOMOD+                                      resp.name = myRespName)

-=-=-=-=-=-=-=-=-=-=-=-=-=-= GuloGulo Data Formating -=-=-=-=-=-=-=-=-=-=-=-=-=-=

> No pseudo absences selection !
      ! No data has been set aside for modeling evaluation
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BIOMOD> # 2. Defining Models Options using default options.
BIOMOD> myBiomodOption <- BIOMOD_ModelingOptions()

BIOMOD> # 3. Doing Modelisation
BIOMOD> 
BIOMOD> myBiomodModelOut <- BIOMOD_Modeling( myBiomodData, 
BIOMOD+                                        models = c('SRE','RF'), 
BIOMOD+                                        models.options = myBiomodOption, 
BIOMOD+                                        NbRunEval=2, 
BIOMOD+                                        DataSplit=80, 
BIOMOD+                                        VarImport=0, 
BIOMOD+                                        models.eval.meth = c('TSS','ROC'),
BIOMOD+                                        do.full.models=FALSE,
BIOMOD+                                        modeling.id="test")


Loading required library...

Checking Models arguments...

Creating suitable Workdir...

	> No weights : all observations will have the same weight


-=-=-=-=-=-=-=-=-=-=-=-=-= GuloGulo Modeling Summary -=-=-=-=-=-=-=-=-=-=-=-=-=

 5  environmental variables ( bio3 bio4 bio7 bio11 bio12 )
Number of evaluation repetitions : 2
Models selected : SRE RF 

Total number of model runs : 4 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


-=-=-=- Run :  GuloGulo_AllData 


-=-=-=--=-=-=- GuloGulo_AllData_RUN1 

Model=Surface Range Envelop
	Evaluating Model stuff...
Model=Breiman and Cutler's random forests for classification and regression
	Evaluating Model stuff...

-=-=-=--=-=-=- GuloGulo_AllData_RUN2 

Model=Surface Range Envelop
	Evaluating Model stuff...
Model=Breiman and Cutler's random forests for classification and regression
	Evaluating Model stuff...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Done -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BIOMOD> ## print a summary of modeling stuff
BIOMOD> myBiomodModelOut

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= BIOMOD.models.out -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Modeling id : test

Species modeled : GuloGulo

Considered variables : bio3 bio4 bio7 bio11 bio12


Computed Models :  GuloGulo_AllData_RUN1_SRE GuloGulo_AllData_RUN1_RF 
GuloGulo_AllData_RUN2_SRE GuloGulo_AllData_RUN2_RF


Failed Models :  none

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> ## plot evaluation models score graph
> 
> ### by models
> gg1 <- models_scores_graph( myBiomodModelOut,
+                             by = 'models',
+                             metrics = c('ROC','TSS') )
Error in grid.Call.graphics(C_setviewport, vp, TRUE) : 
  VECTOR_ELT() can only be applied to a 'list', not a 'double'
Calls: models_scores_graph ... push.vp.vpTree -> push.vp -> push.vp.viewport -> grid.Call.graphics
Execution halted