knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) #system.file("extdata", package = "ResNatSeed") load("~/Pacchetti R/ResNatSeed/inst/extdata/veg.composition.example.RData") library(tidyr)
library(ResNatSeed)
If the study area is beyond the Piedmont Region (North-Western Italy), it is advisable to provide a customized training database (see "Introduction to ResNatSeed" vignette for definitions) through the trainingDB
function before using the RestInd
function.
In order to be processed with the trainingDB
function, the vegetation and topographical variables database (see "Introduction to ResNatSeed" vignette for definitions) must be structured as follows (see Table 1 for an example):
RestInd
[@chang2004]Table 1. Example of the structure of the vegetation and topographical variables database to provide in the function trainingDB
. This database includes 703 vegetation surveys and 532 plant species
veg.composition.example
At this point, the customized training database can be generated by specifying the name of the vegetation and topographical variables database in the data
argument of the trainingDB
function. Through this function it is possible to select the species eligible for the statistical modeling through two arguments:
spe.freq
: this argument allows to set a threshold of minimum frequency of each species in the surveys. It is advisable to set values greater than or equal to 30 to allow appropriate statistical modeling.
min.spe.abundance
: this argument allows to set a threshold of minimum abundance (greater than) of each species in each survey. When NULL
the parameter is set to 0.
training.custom<-trainingDB(data=veg.composition.example, spe.freq = 30,# only species occurring at least in 30 surveys will be retained min.spe.abundance = 1# only species with at least 1% of relative abundance will be retained )
Through trainingDB
function, two dataframes are created and stored in a list, named in this example as 'training.custom'. The two dataframes are:
cep.names
: dataframe with the list of species suitable for modeling and their species codes (CEP names) to be used for the seed mixture or donor grassland composition. In this example 65 species (out of 532) are eligible for modelingtraining.custom$cep.names
trainingDB.ResNatSeed
: training database to use in the RestInd
functionhead(training.custom$trainingDB.ResNatSeed)
From the list of species in training.custom$cep.names
, it is necessary to create a database containing the seed mixture or donor grassland composition. The seed mixture or donor grassland composition must be a dataframe with two columns:
In this example, the donor grassland composition is characterized by four species:
Total abundances amount to 83%. The total abundance of the seed mixture or donor grassland composition should not necessarily amount 100%.
We can generate the dataframe of the donor grassland composition:
donor.composition<-data.frame( species=c("Dactglom","Festaggr","Thymaggr","Lotucorn"), abundance=c(25,35,15,8) ) donor.composition
It is now possible to use the RestInd
function to calculate the Suitability Index (SI) and Reliability Index (RI) by means of the donor grassland composition (dataframe 'donor.composition') and of the elevation, slope, and aspect of restoration site:
Remember that in the trainingDB
argument it must be specified the one created above, i.e. training.custom$trainingDB.ResNatSeed
RestInd(trainingDB = training.custom$trainingDB.ResNatSeed, composition=donor.composition, elevation=1600, slope=10, aspect=110 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.