SlideShare a Scribd company logo
1 of 25
Download to read offline
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Step by step tutorial:
Creating virtual species and
calculating simple ensemble
models with R
(that can be later used with ModestR)
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
What do you need for this tutorial:
1. R version 3.4.0 of higher installed
2. Internet connection
3. About 25 minutes
R software can be freely downloaded from https://www.r-project.org/
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
We’ll describe a simple script to create
random virtual species in R.
We’ll also describe a simple script to
calculate to perform species distribution
modelling with ensemble models in R
Follow the next steps!
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
First of all, download the zip file from this link and decompress it.
You’ll find two scripts:
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Open R console or any other user interface tool for R.
We recommend for example Rwizard (http://www.ipez.es/RWizard/)
Then open the script “Simple Virtual Species.R”
1) Go to menu “File/Open Script” then select the
downloaded script file “Simple virtual Species.R”
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
As you can see at the beginning of the script, it uses the packages raster, rgdal, virtualspecies and dismo. Therefore you
have to install them if you haven’t done it yet. To install packages in R, go to “Packages/Install packages” menu.
You need to have those packages
installed in R
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Following down in the script, there is a section with all the relevant parameters that you have to set to customize it to your
needs. The first part of those parameters concern the folders to be used and the format of the output:
Set in this parameter the CSV format you want
for the output (English-like or Spanish-like)
Set in this parameter the folder where
results will be stored. If the folder does not
exist, the script will create it
Set in this parameter the folder where the environmental
variables to be used to generate virtual species can be
found. They can be, for example, those from WorldClim,
NOOA, Bio-Oracle, etc…
They should be in raster format (geoTiff, ASC, GRD, etc.)
Each parameter is preceded
by an explanatory comment
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The next parameters are related to the geographical extent to be used, the number of virtual species to create, etc.
Set in this parameter the coordinates of the rectangle that
defines the work area. The coordinates must be passed in this
order:
min_longitude, max_longitude, min_latitude, max_latitude
To use the whole available extent covered by the environmental
variables, comment this line.
Set in this parameter the number
of virtual species to be generated
Set in this parameter the number of variables to be used to
generate each virtual species. Those variables will be randomly
selected for each species among the available variables. For
each variable a response function will be randomly selected
among linear, logistic and normal functions.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The next parameters are related to the number of occurrences wanted.
Set in those parameters the range of prevalence of the species to be
generated. The prevalence for each species will be randomly chosen
between those limits.
To use the same prevalence for all species, specify the same value for
minimum and maximum.
Set in those parameters the range for the number of occurrences
you want to obtain for each species. The number of occurrences for
each species will be randomly chosen between those limits.
To obtain always an exact number of occurrences for each species,
specify the same value for minimum and maximum.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The next parameters are related to the number of occurrences wanted.
Set in this parameter TRUE/FALSE depending if you want to
allow duplicate occurences. That is, if multiple samples can
occur in the same cell. This can be useful to mimic real datasets
where samplings can be duplicated or repeated in time.
Set in this parameter to TRUE species suitability will be used to
increase the likehood of sampling in areas with high suitability.
If false, no bias will be used.
Set in this parameter TRUE to rescale all environmental
variables to 0-1. FALSE otherwise. As response functions such
as "dnorm" (normal) will be used expecting a [0-1] range it is
recommend to set it to TRUE
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Once those parameters set according to you needs, you can run the script! This can be done in the Rgui going to the menu
Edit/Run All. Once the work ends, you can see in the console window a report of the virtual species created.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Let’s see now the results. You can find them in the folder you indicated in the OUTPUTFOLDER parameter.
This folder will contains that:
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The Suitability folder contains the suitability map for each species in ASC raster format. Those rasters can be visualized in
any GIS tool, or in ModestR MapMaker, for example, using the menu “Layers/Rasters/Load Raster from ESRI/ASC”.
The values in the suitability map of a species ranges from 0 (unsuitable areas) to 1 (totally suitable areas)
In ModestR MapMaker the
raster is displayed like this
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The Presence folder contains the presence/absence map for each species in ASC raster format. Those rasters can be
visualized in any GIS tool, or in ModestR MapMaker, for example, using the menu “Layers/Rasters/Load Raster from
ESRI/ASC”.
The values in the the presence/absence map of a species are 0 (absence) or 1 (presence)
In ModestR MapMaker the
raster is displayed like this
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The Report.CSV file contains the list of variables used to generate each virtual species
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The VirtualSpeciesOccurrences.CSV contains the occurrences generated for all virtual species. This file may be used to
calculate species distribution models (SDM), as we’ll see next.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Let’s see now how to generate species distribution models (SDM’s) using the script Simple Ensemble models SSMD.R,
which uses the SSDM package.
To do that, in this tutorial we’ll use the virtual species we’ve generated previously.
First of all, load the script in R.
1) Go to menu “File/Open Script” then select the
downloaded script file “Simple Ensemble models SSMD.R”
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
As you can see at the beginning of the script, it uses the packages SSDM, sp and raster. Therefore you have to install them
if you haven’t done it yet. To install packages in R, go to “Packages/Install packages” menu.
You need to have those packages
installed in R
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Following down in the script, there is a section with all the relevant parameters that you have to set to customize it to your
needs. The first part of those parameters concern the folders to be used and the format of the output:
Set in this parameter the CSV format you want
for the output (English-like or Spanish-like)
Set in this parameter the folder where
results will be stored. If the folder does not
exist, the script will create it
Each parameter is preceded
by an explanatory comment
Set in this parameter the folder where the environmental
variables to be used to generate virtual species can be
found. They can be, for example, those from WorldClim,
NOOA, Bio-Oracle, etc…
They should be in raster format (geoTiff, ASC, GRD, etc.)
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The next parameters are related to the geographical extent to be used, the location of the occurrences file and the models
to be used.
Set in this parameter the file (with the full pathname) where the species
occurrences to be used are. For this tutorial you can use the occurrences file
generated previously for the virtual species
Set in this parameter the coordinates of the rectangle that defines the work
area. The coordinates must be passed in this order:
min_longitude, max_longitude, min_latitude, max_latitude
To use the whole available extent covered by the environmental variables,
comment this line
Set in this parameter the models to be used for the ensemble modelling.
The list of available models is enumerated in the comment below. But you can
also see the help for the "ensemble_modelling" function from the SSDM
package for details.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Once those parameters set according to you needs, you can run the script!
This can be done in the Rgui going to the menu Edit/Run All
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
Let’s see now the results. You can find them in the folder you indicated in the OUTPUTFOLDER parameter.
This folder will contains that:
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The tmp folder contains the output of the “ensemble_modelling” function for each species.
See the help for the "ensemble_modelling" function from the SSDM package for details.
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
The OUTPUTFOLDER contains the estimated suitability rasters for each species (not to be confused with the suitability rasters seen
before in this tutorial for the virtual species; the former ones where directly generated using response functions and complete information from
environmental variables; the later ones are estimations of suitability of a species using partial information about the species presence).
Those rasters can be used for different purposes, such as:
• Estimating species composition in one or more regions with KnowBR and ModestR (see tutorial 18 in
http://www.ipez.es/ModestR/Manual_Tutorial.html)
• Importing those suitability rasters to MapMaker or to DataManager , transforming them in species distributions by
selecting a suitability threshold. This feature is explained in the ModestR user manual
(http://www.ipez.es/ModestR/Manual_Tutorial.html)
In ModestR MapMaker the
raster is displayed like this
MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/
It was the Step by step tutorial:
Creating virtual species and calculating simple
ensemble models with R
Thank you for your interest.
You can find this one and other tutorials in http://www.ipez.es/ModestR
By the ModestR team

More Related Content

What's hot

1. How to create a database (Version ModestR v6.5 or higher)
1. How to create a database (Version ModestR v6.5 or higher)1. How to create a database (Version ModestR v6.5 or higher)
1. How to create a database (Version ModestR v6.5 or higher)modestrsoftware
 
8.- Working with shapes (Version ModestR 5.3 or higher)
8.- Working with shapes (Version ModestR 5.3 or higher)8.- Working with shapes (Version ModestR 5.3 or higher)
8.- Working with shapes (Version ModestR 5.3 or higher)modestrsoftware
 
11.- Calculating species distribution for different periods with ModestR (Ve...
11.-  Calculating species distribution for different periods with ModestR (Ve...11.-  Calculating species distribution for different periods with ModestR (Ve...
11.- Calculating species distribution for different periods with ModestR (Ve...modestrsoftware
 
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)modestrsoftware
 
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)modestrsoftware
 
15. Locating species occupied river basins with ModestR (Version ModestR 5.3...
15. Locating species occupied river basins with ModestR  (Version ModestR 5.3...15. Locating species occupied river basins with ModestR  (Version ModestR 5.3...
15. Locating species occupied river basins with ModestR (Version ModestR 5.3...modestrsoftware
 
19. Calculating 3D species distribution in marine habitats with ModestR (Ver...
19.  Calculating 3D species distribution in marine habitats with ModestR (Ver...19.  Calculating 3D species distribution in marine habitats with ModestR (Ver...
19. Calculating 3D species distribution in marine habitats with ModestR (Ver...modestrsoftware
 
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher)
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher) 3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher)
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher) modestrsoftware
 
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...4.- How to use data cleaning, EOO estimation and environmental of occurrence ...
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...modestrsoftware
 
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...modestrsoftware
 
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)modestrsoftware
 
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...modestrsoftware
 
PROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLOPROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLOmhormech
 

What's hot (13)

1. How to create a database (Version ModestR v6.5 or higher)
1. How to create a database (Version ModestR v6.5 or higher)1. How to create a database (Version ModestR v6.5 or higher)
1. How to create a database (Version ModestR v6.5 or higher)
 
8.- Working with shapes (Version ModestR 5.3 or higher)
8.- Working with shapes (Version ModestR 5.3 or higher)8.- Working with shapes (Version ModestR 5.3 or higher)
8.- Working with shapes (Version ModestR 5.3 or higher)
 
11.- Calculating species distribution for different periods with ModestR (Ve...
11.-  Calculating species distribution for different periods with ModestR (Ve...11.-  Calculating species distribution for different periods with ModestR (Ve...
11.- Calculating species distribution for different periods with ModestR (Ve...
 
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)
7.- ModestR tools for taxonomy (Version ModestR v6.5 or higher)
 
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)
25. Phylogenetics trees with ModestRr and bold (Version ModestR 6.5 or higher)
 
15. Locating species occupied river basins with ModestR (Version ModestR 5.3...
15. Locating species occupied river basins with ModestR  (Version ModestR 5.3...15. Locating species occupied river basins with ModestR  (Version ModestR 5.3...
15. Locating species occupied river basins with ModestR (Version ModestR 5.3...
 
19. Calculating 3D species distribution in marine habitats with ModestR (Ver...
19.  Calculating 3D species distribution in marine habitats with ModestR (Ver...19.  Calculating 3D species distribution in marine habitats with ModestR (Ver...
19. Calculating 3D species distribution in marine habitats with ModestR (Ver...
 
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher)
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher) 3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher)
3.- Integrating environmental data in ModestR (Version ModestR v5.3 or higher)
 
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...4.- How to use data cleaning, EOO estimation and environmental of occurrence ...
4.- How to use data cleaning, EOO estimation and environmental of occurrence ...
 
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...
2.- How to create and edit a map using GBIF data (Version ModestR v5.3 or hig...
 
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)
14.- Adding WorldClim data to ModestR (Version ModestR 5.3 or higher)
 
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...
12.- Recommendations for marine environments and Economic Exclusive Zones (Ve...
 
PROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLOPROGRAMA DE EJEMPLO
PROGRAMA DE EJEMPLO
 

Similar to 21.- Creating virtual species and calculating simple ensemble models with R (that can be later used with Version ModestR 5.6 or higher)

Php Map Script Class Reference
Php Map Script Class ReferencePhp Map Script Class Reference
Php Map Script Class ReferenceJoel Mamani Lopez
 
SchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfSchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfDavid Harrison
 
Variants Density along DNA Sequence
Variants Density along DNA SequenceVariants Density along DNA Sequence
Variants Density along DNA SequenceYoann Pageaud
 
Setup Java Path and classpath (from the java™ tutorials essential classes -...
Setup Java Path and classpath (from the java™ tutorials   essential classes -...Setup Java Path and classpath (from the java™ tutorials   essential classes -...
Setup Java Path and classpath (from the java™ tutorials essential classes -...Louis Slabbert
 
Stata Programming Cheat Sheet
Stata Programming Cheat SheetStata Programming Cheat Sheet
Stata Programming Cheat SheetLaura Hughes
 
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxjack60216
 
"PHP from soup to nuts" -- lab exercises
"PHP from soup to nuts" -- lab exercises"PHP from soup to nuts" -- lab exercises
"PHP from soup to nuts" -- lab exercisesrICh morrow
 
Stata cheatsheet programming
Stata cheatsheet programmingStata cheatsheet programming
Stata cheatsheet programmingTim Essam
 
Comparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugComparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugStefano Di Paola
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersUniversity of Huddersfield
 
Biomart Update
Biomart UpdateBiomart Update
Biomart Updatebosc
 
Scaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosScaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosRob Gulewich
 

Similar to 21.- Creating virtual species and calculating simple ensemble models with R (that can be later used with Version ModestR 5.6 or higher) (20)

Php Map Script Class Reference
Php Map Script Class ReferencePhp Map Script Class Reference
Php Map Script Class Reference
 
SchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdfSchemaStudioTypeLandscape_Article.pdf
SchemaStudioTypeLandscape_Article.pdf
 
Easy R
Easy REasy R
Easy R
 
Variants Density along DNA Sequence
Variants Density along DNA SequenceVariants Density along DNA Sequence
Variants Density along DNA Sequence
 
Setup Java Path and classpath (from the java™ tutorials essential classes -...
Setup Java Path and classpath (from the java™ tutorials   essential classes -...Setup Java Path and classpath (from the java™ tutorials   essential classes -...
Setup Java Path and classpath (from the java™ tutorials essential classes -...
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
Stata Programming Cheat Sheet
Stata Programming Cheat SheetStata Programming Cheat Sheet
Stata Programming Cheat Sheet
 
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docxECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
ECS 60 Programming Assignment #1 (50 points) Winter 2016 .docx
 
"PHP from soup to nuts" -- lab exercises
"PHP from soup to nuts" -- lab exercises"PHP from soup to nuts" -- lab exercises
"PHP from soup to nuts" -- lab exercises
 
224-2009
224-2009224-2009
224-2009
 
Stata cheatsheet programming
Stata cheatsheet programmingStata cheatsheet programming
Stata cheatsheet programming
 
Comparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World BugComparing DOM XSS Tools On Real World Bug
Comparing DOM XSS Tools On Real World Bug
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parameters
 
Lampstack (1)
Lampstack (1)Lampstack (1)
Lampstack (1)
 
Biomart Update
Biomart UpdateBiomart Update
Biomart Update
 
Scaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with MesosScaling and Embracing Failure: Clustering Docker with Mesos
Scaling and Embracing Failure: Clustering Docker with Mesos
 
Raptor user manual3.0
Raptor user manual3.0Raptor user manual3.0
Raptor user manual3.0
 
Bioinformatica p4-io
Bioinformatica p4-ioBioinformatica p4-io
Bioinformatica p4-io
 
Basilisk Guide.pdf
Basilisk Guide.pdfBasilisk Guide.pdf
Basilisk Guide.pdf
 

Recently uploaded

Personal Protective Equipment OSHA Regulations
Personal Protective Equipment OSHA RegulationsPersonal Protective Equipment OSHA Regulations
Personal Protective Equipment OSHA RegulationsATI Construction Products
 
Monitoring songbirds' online market
Monitoring songbirds' online market Monitoring songbirds' online market
Monitoring songbirds' online market CIFOR-ICRAF
 
Exploring the snake evolution (wild's gravity).pdf
Exploring the snake evolution (wild's gravity).pdfExploring the snake evolution (wild's gravity).pdf
Exploring the snake evolution (wild's gravity).pdfdrsk203
 
Supporting Farmer Transition to Produce Deforestation-Free Coffee
Supporting Farmer Transition to Produce Deforestation-Free CoffeeSupporting Farmer Transition to Produce Deforestation-Free Coffee
Supporting Farmer Transition to Produce Deforestation-Free CoffeeCIFOR-ICRAF
 
PPT TLE 7 and 8 Q3 AGRI CROP QUIZ 2.pptx
PPT TLE 7 and 8  Q3 AGRI CROP QUIZ 2.pptxPPT TLE 7 and 8  Q3 AGRI CROP QUIZ 2.pptx
PPT TLE 7 and 8 Q3 AGRI CROP QUIZ 2.pptxCrislynBaados
 
Ecosystem and their types ||Environmental Science||.pdf
Ecosystem and their types ||Environmental Science||.pdfEcosystem and their types ||Environmental Science||.pdf
Ecosystem and their types ||Environmental Science||.pdfMUKUL GAUR
 
Incentive Scheme for Smallholders
Incentive Scheme for Smallholders Incentive Scheme for Smallholders
Incentive Scheme for Smallholders CIFOR-ICRAF
 
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...Amil baba
 
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26Item 3. Developing EPOC’s PWB related to mitigation for 2025-26
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26OECD Environment
 
How Long Does It Take Jackfruit To Bear Fruit?
How Long Does It Take Jackfruit To Bear Fruit?How Long Does It Take Jackfruit To Bear Fruit?
How Long Does It Take Jackfruit To Bear Fruit?EvergladesFarm
 
I MSc II Semester - Characteristics of a population.ppt
I MSc II Semester - Characteristics of a population.pptI MSc II Semester - Characteristics of a population.ppt
I MSc II Semester - Characteristics of a population.pptaigil2
 
How do TOPCon Solar Cells/Solar Panel Work?
How do TOPCon Solar Cells/Solar Panel Work?How do TOPCon Solar Cells/Solar Panel Work?
How do TOPCon Solar Cells/Solar Panel Work?Bluebird Solar Pvt. Ltd.
 
Green Horizons: Ecotourism Conference 2024 in Amsterdam
Green Horizons: Ecotourism Conference 2024 in AmsterdamGreen Horizons: Ecotourism Conference 2024 in Amsterdam
Green Horizons: Ecotourism Conference 2024 in AmsterdamDIGITALCONFEX
 
Item 8. Developing EPOC's PWB related to adaptation
Item 8. Developing EPOC's PWB related to adaptationItem 8. Developing EPOC's PWB related to adaptation
Item 8. Developing EPOC's PWB related to adaptationOECD Environment
 
PBL Endangered and Vulnerable Species- Presentation.pptx
PBL Endangered and Vulnerable Species- Presentation.pptxPBL Endangered and Vulnerable Species- Presentation.pptx
PBL Endangered and Vulnerable Species- Presentation.pptxjabernethy
 
Purva Tranquillity best living place in East Bangalore
Purva Tranquillity best living place in East BangalorePurva Tranquillity best living place in East Bangalore
Purva Tranquillity best living place in East BangaloreNikki Harris
 
Item 7. Discussion on PWB 2023-24 work related to adaptation
Item 7. Discussion on PWB 2023-24 work related to adaptationItem 7. Discussion on PWB 2023-24 work related to adaptation
Item 7. Discussion on PWB 2023-24 work related to adaptationOECD Environment
 
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docx
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docxNarrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docx
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docxJeneroseBaldoza
 
Save the Environment - Environ Craft
Save the Environment -     Environ CraftSave the Environment -     Environ Craft
Save the Environment - Environ Craftenvironcraft
 

Recently uploaded (20)

Personal Protective Equipment OSHA Regulations
Personal Protective Equipment OSHA RegulationsPersonal Protective Equipment OSHA Regulations
Personal Protective Equipment OSHA Regulations
 
Monitoring songbirds' online market
Monitoring songbirds' online market Monitoring songbirds' online market
Monitoring songbirds' online market
 
Exploring the snake evolution (wild's gravity).pdf
Exploring the snake evolution (wild's gravity).pdfExploring the snake evolution (wild's gravity).pdf
Exploring the snake evolution (wild's gravity).pdf
 
Supporting Farmer Transition to Produce Deforestation-Free Coffee
Supporting Farmer Transition to Produce Deforestation-Free CoffeeSupporting Farmer Transition to Produce Deforestation-Free Coffee
Supporting Farmer Transition to Produce Deforestation-Free Coffee
 
PPT TLE 7 and 8 Q3 AGRI CROP QUIZ 2.pptx
PPT TLE 7 and 8  Q3 AGRI CROP QUIZ 2.pptxPPT TLE 7 and 8  Q3 AGRI CROP QUIZ 2.pptx
PPT TLE 7 and 8 Q3 AGRI CROP QUIZ 2.pptx
 
Ecosystem and their types ||Environmental Science||.pdf
Ecosystem and their types ||Environmental Science||.pdfEcosystem and their types ||Environmental Science||.pdf
Ecosystem and their types ||Environmental Science||.pdf
 
Incentive Scheme for Smallholders
Incentive Scheme for Smallholders Incentive Scheme for Smallholders
Incentive Scheme for Smallholders
 
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
Best-NO1 Best Black Magic Specialist Near Me Spiritual Healer Powerful Love S...
 
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26Item 3. Developing EPOC’s PWB related to mitigation for 2025-26
Item 3. Developing EPOC’s PWB related to mitigation for 2025-26
 
How Long Does It Take Jackfruit To Bear Fruit?
How Long Does It Take Jackfruit To Bear Fruit?How Long Does It Take Jackfruit To Bear Fruit?
How Long Does It Take Jackfruit To Bear Fruit?
 
International Day of Forests 2024
International Day of Forests 2024International Day of Forests 2024
International Day of Forests 2024
 
I MSc II Semester - Characteristics of a population.ppt
I MSc II Semester - Characteristics of a population.pptI MSc II Semester - Characteristics of a population.ppt
I MSc II Semester - Characteristics of a population.ppt
 
How do TOPCon Solar Cells/Solar Panel Work?
How do TOPCon Solar Cells/Solar Panel Work?How do TOPCon Solar Cells/Solar Panel Work?
How do TOPCon Solar Cells/Solar Panel Work?
 
Green Horizons: Ecotourism Conference 2024 in Amsterdam
Green Horizons: Ecotourism Conference 2024 in AmsterdamGreen Horizons: Ecotourism Conference 2024 in Amsterdam
Green Horizons: Ecotourism Conference 2024 in Amsterdam
 
Item 8. Developing EPOC's PWB related to adaptation
Item 8. Developing EPOC's PWB related to adaptationItem 8. Developing EPOC's PWB related to adaptation
Item 8. Developing EPOC's PWB related to adaptation
 
PBL Endangered and Vulnerable Species- Presentation.pptx
PBL Endangered and Vulnerable Species- Presentation.pptxPBL Endangered and Vulnerable Species- Presentation.pptx
PBL Endangered and Vulnerable Species- Presentation.pptx
 
Purva Tranquillity best living place in East Bangalore
Purva Tranquillity best living place in East BangalorePurva Tranquillity best living place in East Bangalore
Purva Tranquillity best living place in East Bangalore
 
Item 7. Discussion on PWB 2023-24 work related to adaptation
Item 7. Discussion on PWB 2023-24 work related to adaptationItem 7. Discussion on PWB 2023-24 work related to adaptation
Item 7. Discussion on PWB 2023-24 work related to adaptation
 
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docx
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docxNarrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docx
Narrative Report on 3rd NNational Simultaneous Earthquake Drill2023.docx
 
Save the Environment - Environ Craft
Save the Environment -     Environ CraftSave the Environment -     Environ Craft
Save the Environment - Environ Craft
 

21.- Creating virtual species and calculating simple ensemble models with R (that can be later used with Version ModestR 5.6 or higher)

  • 1. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Step by step tutorial: Creating virtual species and calculating simple ensemble models with R (that can be later used with ModestR)
  • 2. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ What do you need for this tutorial: 1. R version 3.4.0 of higher installed 2. Internet connection 3. About 25 minutes R software can be freely downloaded from https://www.r-project.org/
  • 3. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ We’ll describe a simple script to create random virtual species in R. We’ll also describe a simple script to calculate to perform species distribution modelling with ensemble models in R Follow the next steps!
  • 4. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ First of all, download the zip file from this link and decompress it. You’ll find two scripts:
  • 5. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Open R console or any other user interface tool for R. We recommend for example Rwizard (http://www.ipez.es/RWizard/) Then open the script “Simple Virtual Species.R” 1) Go to menu “File/Open Script” then select the downloaded script file “Simple virtual Species.R”
  • 6. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ As you can see at the beginning of the script, it uses the packages raster, rgdal, virtualspecies and dismo. Therefore you have to install them if you haven’t done it yet. To install packages in R, go to “Packages/Install packages” menu. You need to have those packages installed in R
  • 7. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Following down in the script, there is a section with all the relevant parameters that you have to set to customize it to your needs. The first part of those parameters concern the folders to be used and the format of the output: Set in this parameter the CSV format you want for the output (English-like or Spanish-like) Set in this parameter the folder where results will be stored. If the folder does not exist, the script will create it Set in this parameter the folder where the environmental variables to be used to generate virtual species can be found. They can be, for example, those from WorldClim, NOOA, Bio-Oracle, etc… They should be in raster format (geoTiff, ASC, GRD, etc.) Each parameter is preceded by an explanatory comment
  • 8. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The next parameters are related to the geographical extent to be used, the number of virtual species to create, etc. Set in this parameter the coordinates of the rectangle that defines the work area. The coordinates must be passed in this order: min_longitude, max_longitude, min_latitude, max_latitude To use the whole available extent covered by the environmental variables, comment this line. Set in this parameter the number of virtual species to be generated Set in this parameter the number of variables to be used to generate each virtual species. Those variables will be randomly selected for each species among the available variables. For each variable a response function will be randomly selected among linear, logistic and normal functions.
  • 9. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The next parameters are related to the number of occurrences wanted. Set in those parameters the range of prevalence of the species to be generated. The prevalence for each species will be randomly chosen between those limits. To use the same prevalence for all species, specify the same value for minimum and maximum. Set in those parameters the range for the number of occurrences you want to obtain for each species. The number of occurrences for each species will be randomly chosen between those limits. To obtain always an exact number of occurrences for each species, specify the same value for minimum and maximum.
  • 10. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The next parameters are related to the number of occurrences wanted. Set in this parameter TRUE/FALSE depending if you want to allow duplicate occurences. That is, if multiple samples can occur in the same cell. This can be useful to mimic real datasets where samplings can be duplicated or repeated in time. Set in this parameter to TRUE species suitability will be used to increase the likehood of sampling in areas with high suitability. If false, no bias will be used. Set in this parameter TRUE to rescale all environmental variables to 0-1. FALSE otherwise. As response functions such as "dnorm" (normal) will be used expecting a [0-1] range it is recommend to set it to TRUE
  • 11. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Once those parameters set according to you needs, you can run the script! This can be done in the Rgui going to the menu Edit/Run All. Once the work ends, you can see in the console window a report of the virtual species created.
  • 12. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Let’s see now the results. You can find them in the folder you indicated in the OUTPUTFOLDER parameter. This folder will contains that:
  • 13. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The Suitability folder contains the suitability map for each species in ASC raster format. Those rasters can be visualized in any GIS tool, or in ModestR MapMaker, for example, using the menu “Layers/Rasters/Load Raster from ESRI/ASC”. The values in the suitability map of a species ranges from 0 (unsuitable areas) to 1 (totally suitable areas) In ModestR MapMaker the raster is displayed like this
  • 14. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The Presence folder contains the presence/absence map for each species in ASC raster format. Those rasters can be visualized in any GIS tool, or in ModestR MapMaker, for example, using the menu “Layers/Rasters/Load Raster from ESRI/ASC”. The values in the the presence/absence map of a species are 0 (absence) or 1 (presence) In ModestR MapMaker the raster is displayed like this
  • 15. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The Report.CSV file contains the list of variables used to generate each virtual species
  • 16. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The VirtualSpeciesOccurrences.CSV contains the occurrences generated for all virtual species. This file may be used to calculate species distribution models (SDM), as we’ll see next.
  • 17. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Let’s see now how to generate species distribution models (SDM’s) using the script Simple Ensemble models SSMD.R, which uses the SSDM package. To do that, in this tutorial we’ll use the virtual species we’ve generated previously. First of all, load the script in R. 1) Go to menu “File/Open Script” then select the downloaded script file “Simple Ensemble models SSMD.R”
  • 18. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ As you can see at the beginning of the script, it uses the packages SSDM, sp and raster. Therefore you have to install them if you haven’t done it yet. To install packages in R, go to “Packages/Install packages” menu. You need to have those packages installed in R
  • 19. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Following down in the script, there is a section with all the relevant parameters that you have to set to customize it to your needs. The first part of those parameters concern the folders to be used and the format of the output: Set in this parameter the CSV format you want for the output (English-like or Spanish-like) Set in this parameter the folder where results will be stored. If the folder does not exist, the script will create it Each parameter is preceded by an explanatory comment Set in this parameter the folder where the environmental variables to be used to generate virtual species can be found. They can be, for example, those from WorldClim, NOOA, Bio-Oracle, etc… They should be in raster format (geoTiff, ASC, GRD, etc.)
  • 20. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The next parameters are related to the geographical extent to be used, the location of the occurrences file and the models to be used. Set in this parameter the file (with the full pathname) where the species occurrences to be used are. For this tutorial you can use the occurrences file generated previously for the virtual species Set in this parameter the coordinates of the rectangle that defines the work area. The coordinates must be passed in this order: min_longitude, max_longitude, min_latitude, max_latitude To use the whole available extent covered by the environmental variables, comment this line Set in this parameter the models to be used for the ensemble modelling. The list of available models is enumerated in the comment below. But you can also see the help for the "ensemble_modelling" function from the SSDM package for details.
  • 21. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Once those parameters set according to you needs, you can run the script! This can be done in the Rgui going to the menu Edit/Run All
  • 22. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ Let’s see now the results. You can find them in the folder you indicated in the OUTPUTFOLDER parameter. This folder will contains that:
  • 23. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The tmp folder contains the output of the “ensemble_modelling” function for each species. See the help for the "ensemble_modelling" function from the SSDM package for details.
  • 24. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ The OUTPUTFOLDER contains the estimated suitability rasters for each species (not to be confused with the suitability rasters seen before in this tutorial for the virtual species; the former ones where directly generated using response functions and complete information from environmental variables; the later ones are estimations of suitability of a species using partial information about the species presence). Those rasters can be used for different purposes, such as: • Estimating species composition in one or more regions with KnowBR and ModestR (see tutorial 18 in http://www.ipez.es/ModestR/Manual_Tutorial.html) • Importing those suitability rasters to MapMaker or to DataManager , transforming them in species distributions by selecting a suitability threshold. This feature is explained in the ModestR user manual (http://www.ipez.es/ModestR/Manual_Tutorial.html) In ModestR MapMaker the raster is displayed like this
  • 25. MODESTR QUICK TUTORIALS HTTP://WWW.IPEZ.ES/MODESTR/ It was the Step by step tutorial: Creating virtual species and calculating simple ensemble models with R Thank you for your interest. You can find this one and other tutorials in http://www.ipez.es/ModestR By the ModestR team