Skip to content
Prev 488 / 7420 Next

adehabitat: Number of categories of each habitat

Hello Roy,
This line is incorrect (hrrast is an object of class "kasc", it should 
be of class "asc"), and useless since you redefine mcpveg below.
At this point mcpveg is a *matrix* of class "asc".
Because mcpveg is a matrix, calling summary on it computes one summary 
per column of the matrix (which is not what you want). You should first 
convert it to vector. Try:

ta <- table(as.vector(mcpveg))
names(ta) <- levels(mcpveg)[as.numeric(names(ta))]
ta

HTH,


Cl?ment Calenge