Skip to content

V-ratio in bipartite

2 messages · Enrico Barbone, Carsten Dormann

#
Dear Enrico,

the V.ratio function had an error, my serious apologies!
I just uploaded the new version of bipartite (1.03) to CRAN and attach 
the correct code below (how can an error slip into so little, so simple 
code?).

Two further comments:
* Why would anyone be interested in an index devised in '84 and even in 
the original publication regarded as "difficult to interpret"? Ah, but 
then I really am ignorant ...
* By sending the email to r-sig-ecology rather than to me as package 
maintainer directly, you expose my incompetence to the world. 
Weaker-willed scientists than I could be offended by that approach, and 
it deviates from the recommendations of the R mailing list webpage: 
questions about specific packages should go to the package maintainer. 
It certainly made me move quickly ;-)

Best wishes,

Carsten

V.ratio <- function(web){
  # invented by Schluter (1984, Ecology)
  # variable names follow this paper (to avoid having to document the code)
  # be careful with the interpretation!!!

  web <- web>0

  N <- ncol(web) #number of species
  M <- nrow(web) #number of "samples"
  Tj <- colSums(web) #species "density" per sample j
  ni <- rowSums(web) #nr. of individuals per species i
  p <- ni/N

  sigma.i.2 <- p*(1-p)
  S.T.2 <- 1/N*sum((Tj-mean(Tj))^2)
  V <- S.T.2 / sum(sigma.i.2)
  V
}
Enrico Barbone wrote: