ellipsoid_model | R Documentation |
ellipsoid_model helps in finding the centroid and matrix that define an ellipsoid. It uses distinct methods with asumptions that differ from each other.
ellipsoid_model(data, species, longitude, latitude, raster_layers,
method = "covmat", level = 95, truncate = TRUE, replicates = 1,
replicate_type = "bootstrap", bootstrap_percentage = 75,
projection_variables = NULL, prvariables_format = NULL,
prediction = "suitability", return_numeric = TRUE,
tolerance = 1e-60, format = "GTiff",
overwrite = FALSE, color_palette = viridis::magma,
output_directory = "ellipsenm_model")
data |
data.frame of occurrence records. Columns must be: species,
longitude, and latitude. Optionally, if |
species |
(character) name of the column with the name of the species. |
longitude |
(character) name of the column with longitude data. |
latitude |
(character) name of the column with latitude data. |
raster_layers |
RasterStack of at least two environmental variables to be
extracted using geographic coordinates present in |
method |
(character) method to construct the ellipsoid that characterizes
the species ecological niche. Available methods are: "covmat", "mve1", and
"mve2". See details of |
level |
(numeric) the confidence level of a pairwise confidence region for the ellipsoid, expresed as percentage. Default = 95. |
truncate |
(logical) whether or not to truncate values of suitability based on ellipsoid limits. All values outside the ellipsoid will be zero. Default = TRUE. |
replicates |
(numeric) number of replicates to perform. Default = 1 produces a single model using all the data. |
replicate_type |
(character) type of replicates to perform. Options are:
"bootstrap" and "jackknife"; default = "bootstrap". See details. Ignored if
|
bootstrap_percentage |
(numeric) percentage of data to be bootstrapped
for each replicate. Default = 50. Valid if |
projection_variables |
optional, (RasterStack, list, or character): if RasterStack, a stack of layers respresenting an only scenario for projection; if list, a named list of RasterStacks representing multiple scenarios for projection; if character, name of the folder (in the working directory) containing other folders (scenarios for projection) with raster layers to be used as variables. See details. Default = NULL. |
prvariables_format |
(character) if |
prediction |
(character) type of prediction to be made, options are: "suitability", "mahalanobis", and "both". Default = "suitability". |
return_numeric |
(logical) whether or not to return values of mahalanobis
distance and suitability as part of the results (it depends on the type of
|
tolerance |
the tolerance for detecting linear dependencies. Default = 1e-60. |
format |
(charater) file type for raster outputs to be written in
|
overwrite |
(logical) whether or not to overwrite exitent results in
|
color_palette |
a color palette function to be used in plotting suitability values in an HTML report produced at the end of all analyses. |
output_directory |
name of the folder were all results will be written. This avoids saturation of the RAM. |
replicate_type
projection_variables
An object of class ellipsoid_model_sim
or
ellipsoid_model_rep
.
# reading data
occurrences <- read.csv(system.file("extdata", "occurrences.csv",
package = "ellipsenm"))
# raster layers of environmental data
vars <- raster::stack(list.files(system.file("extdata", package = "ellipsenm"),
pattern = "bio", full.names = TRUE))
# creating the model with no replicates
ell_model <- ellipsoid_model(data = occurrences, species = "species",
longitude = "longitude", latitude = "latitude",
raster_layers = vars, method = "covmat", level = 99,
replicates = 1, prediction = "suitability",
return_numeric = TRUE, format = "GTiff",
overwrite = FALSE, output_directory = "ellipsenm_model")
class(ell_model)
# check your directory, folder "ellipsenm_model"
# creating the model with replicates
ell_model1 <- ellipsoid_model(data = occurrences, species = "species",
longitude = "longitude", latitude = "latitude",
raster_layers = vars, method = "covmat", level = 99,
replicates = 5, prediction = "suitability",
return_numeric = TRUE, format = "GTiff",
overwrite = FALSE, output_directory = "ellipsenm_model1")
class(ell_model1)
# check your directory, folder "ellipsenm_model1"
# creating the model with projections
pr_vars <- raster::stack(system.file("extdata", "proj_variables.tif",
package = "ellipsenm"))
names(pr_vars) <- names(vars)
ell_model2 <- ellipsoid_model(data = occurrences, species = "species",
longitude = "longitude", latitude = "latitude",
raster_layers = vars, method = "covmat", level = 99,
replicates = 3, replicate_type = "bootstrap",
bootstrap_percentage = 75, projection_variables = pr_vars,
prediction = "suitability", return_numeric = TRUE,
format = "GTiff", overwrite = FALSE,
output_directory = "ellipsenm_model2")
class(ell_model2)
# check your directory, folder "ellipsenm_model2"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.