Ecological-niche factor analysis
Performs ecological-niche factor analysis using environmental raster data and species presence data.
enfa(x, s.dat, ...) ## S4 method for signature 'GLcenfa,Raster' enfa( x, s.dat, filename = "", progress = FALSE, parallel = FALSE, n = 1, cl = NULL, keep.open = FALSE, ... ) ## S4 method for signature 'GLcenfa,Spatial' enfa( x, s.dat, field, fun = "last", filename = "", progress = FALSE, parallel = FALSE, n = 1, cl = NULL, keep.open = FALSE, ... ) ## S4 method for signature 'Raster,Raster' enfa( x, s.dat, scale = TRUE, filename = "", progress = FALSE, parallel = FALSE, n = 1, cl = NULL, keep.open = FALSE, ... ) ## S4 method for signature 'Raster,Spatial' enfa( x, s.dat, field, fun = "last", scale = TRUE, filename = "", progress = FALSE, parallel = FALSE, n = 1, cl = NULL, keep.open = FALSE, ... )
x |
Raster* object, typically a brick or stack of ecological raster layers,
or a |
s.dat |
RasterLayer, SpatialPolygons*, or SpatialPoints* object indicating species presence or abundance |
... |
Additional arguments for |
filename |
character. Optional filename to save the Raster* output to
file. If this is not provided, a temporary file will be created for large |
progress |
logical. If |
parallel |
logical. If |
n |
numeric. Number of CPU cores to utilize for parallel processing |
cl |
optional cluster object |
keep.open |
logical. If |
field |
field of |
fun |
function or character. Determines what values to assign to cells
with multiple spatial features, similar to the |
scale |
logical. If |
The cnfa
function is not to be confused with the enfa
function. enfa
performs ENFA as described by Hirzel et al. (2002) and
Basille et al. (2008), and is offered as an alternative to the enfa
function in the adehabitatHS
package. CENFA::enfa
will give
different results than adehabitatHS::enfa
for versions of adehabitatHS
0.3.13 or earlier, however, for two primary reasons.
First, CENFA::enfa
corrects a minor mistake in the calculation of
the species covariance matrix. This correction influences the values of the
coefficients of specialization in each ecological variable, which will lead to
a different interpretation of the degree of specialization. Second, we define
the overall marginality M as the norm of the marginality factor mf
,
rather than the square of the norm of mf
.
The default fun = 'last'
gives equal weight to each occupied cell.
If multiple species observations occur in the same cell, the cell will only
be counted once. fun = 'count'
will weight the cells by the number
of observations.
If there is too much correlation between the layers of x
, the global
covariance matrix will be singular, and the overall marginality will not be
meaningful. In this case, a warning is issued and marginality
is
returned as NA
.
Returns an S4 object of class enfa
with the following components:
Original function call
Marginality factor. Vector that describes the location of the species Hutchinsonian niche relative to the global niche
Magnitude of the marginality factor
Specialization factor. Vector of eigenvalues of specialization
Square root of the mean of the specialization factor
Vector representing the proportion of specialization found in each ENFA factor
A matrix describing the amount of marginality and specialization on each ENFA factor
RasterBrick of transformed climate values, with p layers
Raster layer of weights used for ENFA calculation
Basille, Mathieu, et al. Assessing habitat selection using multivariate statistics: Some refinements of the ecological-niche factor analysis. Ecological Modelling 211.1 (2008): 233-240.
Hirzel, Alexandre H., et al. Ecological-niche factor analysis: how to compute habitat-suitability maps without absence data?. Ecology 83.7 (2002): 2027-2036.
mod1 <- enfa(x = climdat.hist, s.dat = ABPR, field = "CODE") # using GLcenfa as an initial step # for multi-species comparison glc <- GLcenfa(x = climdat.hist) mod2 <- enfa(x = glc, s.dat = ABPR, field = "CODE") all.equal(m.factor(mod1), m.factor(mod2))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.