I wanted to use the compana() function from the adehabitat package in R. I don't really understand the meaning of the data in the example they provide (from aebisher et al., 1993).

The two main arguments of the compana function are:

compana(used, avail, other.arguments…)

  1. used
    a matrix or a data frame describing the percentage of use of habitats (in columns) by animals (in rows).

  2. avail
    a matrix or a data frame describing the percentage of availability of habitats (in columns) by animals (in rows).

What does...

"[..] a data frame describing the percentage of availability of habitats by animals"

mean ?

By 'Availability of a habitat', I guess it means the proportions of these habitats that were not used. Isn't it? But then, how can this be categorized into different species?

I guess I am missing something easy in the functioning of this statistical tool!

One can run that in R to get more info:

# The following code comes from the example provided in the help page
compana(pheasant$mcp, pheasant$studyarea,
                   test = "parametric")

1 Answer 1


Not 100% sure, but this would be my guess:

"used" would be the percent of time spent in a certain habitat, while "avail" is the amount of that habitat that specific animal encounters in its life. This example explains what I mean:

Say you have some sort of ground squirrel that lives in rocky outcrop(R). Next to the hole is a field (F), and across the field are some trees(T) with squirrel food in them. The squirrel spends all of its time in these three habitats, but it doesn't like the field much because its exposed and can be attacked by predators, so when it goes out for food it runs quickly across the field, gets food, and runs back. Say it spends 60% of its time at home, 10% of its time running through the field, and 30% of its time in the trees eating. Those give you your "used" numbers. But, the relative proportion of the habitats that the squirrel ever occupies (relative size), are very different. By area, the field is 75%, the trees are 15%, and the rocks are 10%. In this example, your "used" matrix would look like this:

            R    F    T
Squirrel  0.6  0.1  0.3

and your "avail" matrix would look like this:

            R    F    T
Squirrel  0.1  0.75  0.15

With this information you can do a statistics to test whether the squirrel randomly picks habitats, or prefers certain ones. If it randomly picked habitats, you'd expect it's "used" percentages to look like its "avail" percentages, i.e. it spends ~75% of its time in the field because it just wanders around aimlessly between rocks, field and trees. But since you observe a pretty sizable increase in time spent in low-availability habitats, you are likely to see a statistically significant preference for certain habitats (rocks for sure, and maybe trees).

Then, if you have multiple species, this program probably tests to see how similar two species' patterns of habitat preference and avoidance are, and uses that to define niche overlap. The "avail" could be the same if they both travel through the same rocks, field and trees, but if another species has a larger foraging area, its F and T percentages in the "avail" matrix will go up relative to the R.

Again, not totally certain about this interpretation, but it seems to make sense to me from the R documentation.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .