[Esm-commits] r22 - in pkg/ESM: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 1 12:00:14 CET 2010


Author: timotheepoisot
Date: 2010-02-01 12:00:14 +0100 (Mon, 01 Feb 2010)
New Revision: 22

Modified:
   pkg/ESM/DESCRIPTION
   pkg/ESM/R/functions.r
   pkg/ESM/man/getspe.Rd
Log:
v 1,4, LSD replaced BDF/FD

Modified: pkg/ESM/DESCRIPTION
===================================================================
--- pkg/ESM/DESCRIPTION	2009-12-12 18:14:29 UTC (rev 21)
+++ pkg/ESM/DESCRIPTION	2010-02-01 11:00:14 UTC (rev 22)
@@ -1,5 +1,5 @@
 Package: ESM
-Version: 0.1.2-01
+Version: 0.1.4-01
 Date: 2009-11-06
 Title: Ecological Specificity Measures
 Author: Timothee Poisot <tpoisot at um2.fr>

Modified: pkg/ESM/R/functions.r
===================================================================
--- pkg/ESM/R/functions.r	2009-12-12 18:14:29 UTC (rev 21)
+++ pkg/ESM/R/functions.r	2010-02-01 11:00:14 UTC (rev 22)
@@ -1,4 +1,4 @@
-get.DBF <- function(fit)
+get.LSD <- function(fit)
 {
 	fit <- sort(as.vector(fit),decreasing=TRUE)
 	test <- fit[2:length(fit)]
@@ -10,7 +10,7 @@
 {
 	Ni <- sum(pop>0)
 	N <- length(pop)
-	return(1-Ni/N)
+	return(1-(Ni-1)/(N-1))
 }
 
 get.HS <- function(pop)
@@ -36,12 +36,12 @@
 	return(SSI)
 }
 
-dbf <- function(m)
+lsd <- function(m)
 {
 	spe <- vector('numeric',length=nrow(m))
 	for(i in 1:nrow(m))
 	{
-		spe[i] <- get.DBF(m[i,])
+		spe[i] <- get.LSD(m[i,])
 	}
 	return(spe)
 }
@@ -76,7 +76,7 @@
 	return(spe)
 }
 
-getspe <- function(mat,measure=hr)
+getspe <- function(mat,measure=lsd)
 {
 	if(max(mat)!=1){mat<-mat/max(mat)}
 	out <- measure(as.matrix(mat))

Modified: pkg/ESM/man/getspe.Rd
===================================================================
--- pkg/ESM/man/getspe.Rd	2009-12-12 18:14:29 UTC (rev 21)
+++ pkg/ESM/man/getspe.Rd	2010-02-01 11:00:14 UTC (rev 22)
@@ -16,9 +16,9 @@
 	\item{}{A vector with the specificity of each organism. Uses names if the matrix as such property.}
 }
  
-\details{Values of \kbd{measure} can be : \kbd{hr}, the classical host range; \kbd{ssi}, the species specialization index; \kbd{dfp}, the DFP index; \kbd{shannon}, Shannon's entropy; \kbd{wadfp}, the weighted additive DFP.}
+\details{Values of \kbd{measure} can be : \kbd{hr}, the classical host range; \kbd{ssi}, the species specialization index; \kbd{fd}, the Fitness Differences index; \kbd{hs}, Shannon's entropy.}
 
-\references{For DFP and WADFP, and this package, cite : Poisot, T & Hochberg, M E "..." XXX.
+\references{For FD, and this package, cite : Poisot, T & Hochberg, M E "..." XXX.
 
 For HS, cite : Schug J, et al. (2005) Promoter features related to tissue specificity as measured by Shannon entropy. Genome biology 6(4):R33
 



More information about the Esm-commits mailing list