Hi Denis,

I am new to the list and would like to start with a question. I would be glad if someone could help me drawing the niche representation of individual animals as one of the results of K-select analysis. The graph I am talking about is the one in Calenge et al.'s 2005 Ecological Modelling paper, Figure 4 (a).
Thanks to everyone.

A combination of the functions s.value (from the package ade4) and scatterniche can be used (just copy and paste):

## prepare the data
data(puechabon)
sahr <- puechabon$sahr
x <- sahrlocs2kselect(sahr)
tab <- x$tab
tab$Aspect <- NULL

## perform the K-select analysis
acp <- dudi.pca(tab, scannf = FALSE, nf = 2)
kn <- kselect(acp, x$factor, x$weight,
                     scannf = FALSE, nf = 2)


## split the coordinates of the pixels by animal
lcoo <- split(as.data.frame(kn$ls), x$factor)
## split the weight of the pixels by animall
lwei <- split(x$weight, x$factor)

## Example for the first animal:
coo1 <- lcoo[[1]]
wei1 <- lwei[[1]]

## draw the graph of the coordinates for the first animal:
scatterniche(coo1, wei1, percent=100)
s.label(coo1, clab=0, add.p=TRUE)
s.value(coo1, wei1, add.p=TRUE)

## and for all the animals:
par(mfrow=n2mfrow(length(lcoo)))
lapply(1:length(lcoo), function(i) {
   coo1 <- lcoo[[i]]
   wei1 <- lwei[[i]]
   scatterniche(coo1, wei1, percent=100)
   s.label(coo1, clab=0, add.p=TRUE)
   s.value(coo1, wei1, add.p=TRUE)
})


You might also want to consider the functions kplot.kselect and s.distri from the package ade4 perform similar graphs, see the examples of the help page of kplot.kselect.
Hope this helps,

Clément Calenge
--

Clément CALENGE
Office national de la chasse et de la faune sauvage
Saint Benoist - 78610 Auffargis
tel. (33) 01.30.46.54.14

_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov

Reply via email to