Learn R Programming

adehabitatHS (version 0.3.11)

kselect: K-Select Analysis: a Method to Analyse the Habitat Selection by Animals

Description

Performs a multivariate analysis of ecological data (K-select analysis).

Usage

kselect(dudi, factor, weight, scannf = TRUE, nf = 2, ewa = FALSE)
## S3 method for class 'kselect':
print(x, \dots)
## S3 method for class 'kselect':
kplot(object, xax = 1, yax = 2, csub = 2, possub = c("topleft",
              "bottomleft", "bottomright", "topright"),
              addval = TRUE, cpoint = 1, csize = 1, clegend = 2, ...)
## S3 method for class 'kselect':
hist(x, xax = 1, mar=c(0.1,0.1,0.1,0.1),
             ncell=TRUE, csub=2,
             possub=c("bottomleft", "topleft",
                      "bottomright", "topright"),
             ncla=15, ...)
## S3 method for class 'kselect':
plot(x, xax = 1, yax = 2, \dots)
prepksel(sa, hr, locs)

Arguments

dudi
an object of class dudi
factor
a factor with the same length as nrow(dudi$tab)
weight
a numeric vector of integer values giving the weight associated to the rows of dudi$tab
scannf
logical. Whether the eigenvalues bar plot should be displayed
nf
if scannf = FALSE, an integer indicating the number of kept axes
ewa
logical. If TRUE, uniform weights are given to all animals in the analysis. If FALSE, animal weights are given by the proportion of relocations of each animal (i.e. an animal with 10 relocations has a weight 10 tim
x, object
an object of class kselect
xax
the column number for the x-axis
yax
the column number for the y-axis
addval
logical. If TRUE, the frequency of the relocations per animal is displayed (see examples)
cpoint
the size of the points (if 0, the points where no relocations are found are not displayed)
mar
the margin parameter (see help(par))
ncell
logical. If TRUE, the histogram shows the distribution of the cells of the raster map where at least one relocation is found. If FALSE, the histogram shows the distribution of the relocations
csub
the character size for the legend, used with par("cex")*csub
csize
the size coefficient for the points
clegend
the character size for the legend used by par("cex")*clegend
possub
a character string indicating the sub-title position ("topleft", "topright", "bottomleft", "bottomright")
ncla
the number of classes of the histograms
sa
an object of class SpatialPixelsDataFrame containing the values of the environmental variables on the study area
hr
an object of class SpatialPixelsDataFrame with the same number of rows as sa, for which the pixels contain 1 inside the home ranges of the animals (one animal per column) and NA otherwise
locs
an object of class SpatialPixelsDataFrame with the same dimensions as hr, containing the number of relocations of the animals (columns) in each pixel of sa (rows)
...
additional arguments to be passed to the generic function histniche, print or, in the case of plot.kselect, s.distri

Value

  • kselect returns a list of the class kselect and dudi (see dudi).

Details

The K-select analysis is intended for hindcasting studies of habitat selection by animals using radio-tracking data. Each habitat variable defines one dimension in the ecological space. For each animal, the difference between the vector of average available habitat conditions and the vector of average used conditions defines the marginality vector. Its size is proportional to the importance of habitat selection, and its direction indicates which variables are selected. By performing a non-centered principal component analysis of the table containing the coordinates of the marginality vectors of each animal (row) on the habitat variables (column), the K-select analysis returns a linear combination of habitat variables for which the average marginality is greatest. It is a synthesis of variables which contributes the most to the habitat selection. As with principal component analysis, the biological significance of the factorial axes is deduced from the loading of variables. prepksel allows to prepare the data for the kselect analysis (see examples). plot.kselect returns a summary of the analysis: it displays (i) a graph of the correlations between the principal axes of the PCA of the objects of class dudi passed as argument and the factorial axes of the K-select analysis; (ii) a graph giving the scores of the habitat variables on the factorial axes of the K-select analysis; (iii) the barplot of the eigenvalues of the analysis (each eigenvalue measure the mean marginality explained by the axis; (iv) the projection of the non-recentred marginality vectors on the factorial plane (the origin of the arrow indicates the average available habitat conditions, and the end of the arrow indicates the average used conditions); (v) the projection of the resource units available to each animal on the first factorial plane and (vi) the coordinates of the recentred marginality vectors (i.e. recentred so that they have a common origin) on the first factorial plane. kplot.kselect returns one graph per animal showing the projections of the available resource units on the factorial plane, as well as their use by the animal. hist.kselect does the same thing, but on one dimension instead of two.

References

Calenge, C., Dufour, A.B. and Maillard, D. (2005) K-select analysis: a new method to analyse habitat selection in radio-tracking studies. Ecological modelling, 186, 143--153.

See Also

s.distri, and dudi for class dudi.

Examples

Run this code
## Load the data
data(puechabonsp)

locs <- puechabonsp$relocs
map <- puechabonsp$map


## compute the home range of animals (e.g. using the minimum convex
## polygon)
pc <- mcp(locs[,"Name"])

## rasterize it
hr <- hr.rast(pc, map)


## Compute the number of relocation in each pixel of the map
cp <- count.points(locs[,"Name"], map)

## prepares the data for the kselect analysis
x <- prepksel(map, hr, cp)
tab <- x$tab

## Example of analysis with two variables: the slope and the elevation.
## Have a look at the use and availability of the two variables
## for the 4 animals
tab <- tab[,((names(tab) == "Slope")|(names(tab) == "Elevation"))]
tab <- scale(tab)
tmp <- split.data.frame(tab, x$factor)
wg <- split(x$weight, x$factor)
opar <- par(mfrow = n2mfrow(nlevels(x$factor)))
for (i in names(tmp))
  s.distri(scale(tmp[[i]]), wg[[i]])
par(opar)

## We call a new graphic window
x11()
## A K-select analysis
acp <- dudi.pca(tab, scannf = FALSE, nf = 2)
kn <- kselect(acp, x$factor, x$weight,
 scannf = FALSE, nf = 2)

# use of the generic function scatter
scatter(kn)

# Displays the first factorial plane
kplot(kn)
kplot(kn, cellipse = 0, cpoint = 0)
kplot(kn, addval = FALSE, cstar = 0)

# this factorial plane can be compared with
# the other graph to see the rotation proposed by
# the analysis
graphics.off()

# Displays the first factorial axis
hist(kn)

# Displays the second factorial axis
hist(kn, xax = 2)

# Summary of the analysis
plot(kn)

Run the code above in your browser using DataLab