BIOMOD.models.out-RemoveProperly: remove properly BIOMOD_Modeling outputs

Description Usage Arguments Details Author(s) See Also Examples

Description

Functions to free properly a BIOMOD_Modeling outputs

Usage

1
  RemoveProperly(obj, obj.name=deparse(substitute(obj)), ...)

Arguments

obj

"BIOMOD.models.out" object

obj.name

the name of object in current environment, automatically filled

...

extra arguments (not implemented yet)

Details

This function will remove all objects created during a biomod2 modeling run. It will free both objects saved in memory and objects saved on hard drive.

Author(s)

Wilfried Thuiller, Damien Georges

See Also

help

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  ## Not run: 
  # species occurrences
  DataSpecies <- read.csv(system.file("external/species/mammals_table.csv",
                                    package="biomod2"), row.names = 1)
  head(DataSpecies)
  
  # the name of studied species
  myRespName <- 'VulpesVulpes'
  
  # the presence/absences data for our species 
  myResp <- as.numeric(DataSpecies[,myRespName])
  
  # the XY coordinates of species data
  myRespXY <- DataSpecies[,c("X_WGS84","Y_WGS84")]
  
  
  # Environmental variables extracted from BIOCLIM (bio_3, bio_4, bio_7, bio_11 & bio_12)
  myExpl = raster::stack( system.file( "external/bioclim/current/bio3.grd", 
                       package="biomod2"),
                  system.file( "external/bioclim/current/bio4.grd", 
                               package="biomod2"), 
                  system.file( "external/bioclim/current/bio7.grd", 
                               package="biomod2"),  
                  system.file( "external/bioclim/current/bio11.grd", 
                               package="biomod2"), 
                  system.file( "external/bioclim/current/bio12.grd", 
                               package="biomod2"))
  
  # 1. Formatting Data
  myBiomodData <- BIOMOD_FormatingData(resp.var = myResp,
                                       expl.var = myExpl,
                                       resp.xy = myRespXY,
                                       resp.name = myRespName)
  
  # 2. Defining Models Options using default options.
  myBiomodOption <- BIOMOD_ModelingOptions()
  
  # 3. Doing Modelisation
  
  myBiomodModelOut <- BIOMOD_Modeling( myBiomodData, 
                                       models = c('SRE'), 
                                       models.options = myBiomodOption, 
                                       NbRunEval=1, 
                                       DataSplit=80, 
                                       Prevalence=0.5, 
                                       VarImport=0, 
                                       models.eval.meth = c('TSS','ROC'),
                                       do.full.models=FALSE,
                                       modeling.id="test2")
  
  # files have been created on hard drive
  list.files(myRespName,all.files=TRUE,recursive=TRUE)
  
  # remove properly the modeling objects and all the file saved on hard drive
  RemoveProperly(myBiomodModelOut)
  
  # check files had been removed
  list.files(myRespName,all.files=TRUE,recursive=TRUE)
  
## End(Not run)

biomod2 documentation built on May 2, 2019, 5:08 p.m.