Description Usage Arguments Value Examples
Function fit an ellipsoid model using the shape matrix (covariance matrix) of the niche variables.
1 2 3 | ellipsoidfit(data, centroid, covar, level = 0.95, threshold = 0.05,
plot = T, size, xlab1 = "niche var 1", ylab1 = "niche var 2",
zlab1 = "Suitability", ...)
|
data |
A RasterStack or RasterBrick objet of the niche varibles. |
centroid |
A vector with the values of the centers of the ellipsoid (see |
covar |
The shape matrix (covariance) of the ellipoid (see |
level |
The proportion of points to be included inside the ellipsoid |
threshold |
Threshold value for the suitabilities to be cosidered as 0, by default all suiabilities <0.05 are cosidered as zeros |
plot |
Logical If True a plot of niche will be shown. |
size |
The size of the points of the niche plot. |
Returns a list containing a data.frame with the suitability values; a suitability raster; a data.frame with the mahalanobis and euclidean distances to the centroid.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Load niche data
# d_cardon <- read.csv(system.file("extdata", "cardon_virtual.csv", package = "nichetoolbox"))
## Compute the centroid and shape (covariance matrix) of the ellipsoid model.
# covar_centroid <- cov_center(d_cardon,mve=TRUE,level=0.99,vars=c(3,4,5))
## RasterStack with the niche variables
# nicheStack <- stack(list.files(system.file("extdata",
# package = "nichetoolbox"),
# pattern = ".asc$",full.names = TRUE))
# Fitting the ellipsoid model
# ellipsoidMod <- ellipsoidfit(nicheStack,
# covar_centroid$centroid,
# covar_centroid$covariance,
# level=0.95,threshold=0.05,plot=TRUE,size=3)
# plot(ellipsoidMod$suitRaster)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.