kuenm_hierpart: Hierarchical partition of the variance coming from distinct...

View source: R/kuenm_hierpart.R

kuenm_hierpartR Documentation

Hierarchical partition of the variance coming from distinct sources in ENMs

Description

kuenm_hierpart has been deprecated for the moment. A future, more complete version will be available soon.

Usage

kuenm_hierpart(sp.name, fmod.dir, is.swd, format = "ascii", replicated, project,
               current = NULL, time.periods = NULL, emi.scenarios = NULL,
               clim.models = NULL, ext.type, iterations = 100,
               sample.size = 1000, set.seed = 1, keep.tables = FALSE,
               factors.col = NULL, out.dir, verbose = TRUE)

Arguments

sp.name

(character) name of the species. This name must be the one that appears as part of the raster file of each model replicate. If results are from Maxent, this is the name that is in the first column of the csv containing species occurrence data (species) but spaces replaced by "_".

fmod.dir

(character) name of the folder where all models are (e.g., the output folder after using the kuenm_mod) function.

is.swd

(logical) whether model calibration and final models were produced using SWD format.

format

(character) format of model raster files. Options are "ascii", "GTiff", and "EHdr" = bil. Default = "ascii".

replicated

(logical) whether or not models were created with replicates.

project

(logical) if TRUE, it is assumed that models were projected to other scenarios. These scenarios can be current (projections in space), and/or future or past (projections in time).

current

(character) pattern to look for when defining which is the raster file representing current projections. If NULL, results will be produced for the area of calibration, and if any of time.periods, clim.models, or emi.scenarios is defined, results will be be produced for these variance sources as well.

time.periods

(character) pattern to be searched to identify model projections to distinct time periods. If NULL, the default, it is assumed that only one time period was considered.

emi.scenarios

(character) pattern to be searched to identify distinct emission scenarios (e.g., "recp45"). If NULL, the default, it is assumed that only one emission scenario was used. Therefore, this source of variation will not be considered.

clim.models

(character) names that identify climatic models used for project ENMs. If NULL, the default, it is assumed that only one climate model was used. Therefore, this source of variation will not be considered.

ext.type

(character) pattern(s) to be searched in the folders inside fmod.dir that identify the extrapolation type(s) used in model projections. This pattern(s) needs to be clearly distinguishable from the other parts of the name of the folder name containing the model. For instance, "EC" will be the patter that denotes extrapolation and clamping in the folder named "M_0.1_F_l_set1_EC".

iterations

(numeric) number of iterations to be performed in the hierarchical partitioning analysis. Default = 100.

sample.size

(numeric) number of pixels to be sampled per each model. Default = 1000. Increasing this number is recommended when the number of models and the computer features allow it.

set.seed

(numeric) initial seed to be set before running analysis.

keep.tables

(logical) if TRUE, tables that are written in out.dir for each iteration of the hierarchical partitioning analyses are kept. Default = FALSE.

factors.col

a vector of colors for the bars to be plotted; if not defined, a gray color palette is used.

out.dir

(character) name of the output directory to be created where results of the hierarchical partitioning analysis will be written.

verbose

(logical) whether to print messages; default = TRUE.

Details

If the length of any of the potential sources of variation is equal to one (e.g., only one parameter, or only one climate model), this source of variation will not be considered.

Users must be specific when defining the patterns that the function will search for. These patterns must be part of the raster file names of the models so the function can locate each file without problems.

Error whiskers in resulting plots represent the 95% Confidence Interval of the mean. This interval is calculated using a bootstrap approach.

Value

The function returns a list containing the summary of total effects of factors on variance contained in the models (mean and confidence intervals of total effects). A plot of these values is also returned.

Other results are written in out.dir. Folders named Variation or HP_results_(EC, NE, and/or E, depending on ext.type) containing csv files with the results of the hierarchical partitioning analyses an a plot summarizing the total effects of the sources of variation on the variance in the models.


manubio13/ku.enm documentation built on Jan. 5, 2024, 5:55 a.m.