# Artificial Example
art <- c(1,1,1,0,0,0,
0,0,0,1,1,0,
0,0,0,0,0,1)
art.data <- matrix(art, nrow=3, ncol=6, byrow=TRUE)
art.out <- directional.response(art.data, method="overlap",relativize=NULL)
# Real data example: the Doubs River fish data (Verneaux 1973), available in ade4.
# 30 sites, 27 species. No fish had been caught at site 8; remove that site
if(require("ade4", quietly = TRUE)) {
data(doubs)
dim(doubs$fish)
fish <- doubs$fish[-8,]
dim(fish)
doubs.out <- directional.response(fish, method="gain", relativize="S")
}
Run the code above in your browser using DataLab