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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 11 20:59:18 CET 2009


Author: timotheepoisot
Date: 2009-11-11 20:59:18 +0100 (Wed, 11 Nov 2009)
New Revision: 6

Modified:
   pkg/ESM/DESCRIPTION
   pkg/ESM/R/functions.r
   pkg/ESM/man/GDS.Rd
Log:
Changes in the GDS function, now returns a named list

Modified: pkg/ESM/DESCRIPTION
===================================================================
--- pkg/ESM/DESCRIPTION	2009-11-10 16:38:03 UTC (rev 5)
+++ pkg/ESM/DESCRIPTION	2009-11-11 19:59:18 UTC (rev 6)
@@ -1,5 +1,5 @@
 Package: ESM
-Version: 0.0.2-01
+Version: 0.1.0-01
 Date: 2009-11-06
 Title: Ecological Specificity Measures
 Author: Timothee Poisot <timothee.poisot at univ-montp2.fr>, Michael E Hochberg <michael.hochberg at univ-montp2.fr>

Modified: pkg/ESM/R/functions.r
===================================================================
--- pkg/ESM/R/functions.r	2009-11-10 16:38:03 UTC (rev 5)
+++ pkg/ESM/R/functions.r	2009-11-11 19:59:18 UTC (rev 6)
@@ -129,9 +129,12 @@
 	D <- dim(mat)
 	N <- prod(D)
 	Ni <- sum(mat>0)/N
-	result <- matrix(c(D,N,Ni),nrow=1)
-	colnames(result) <- c('Resources','Organisms','Size','Completeness')
-	print(result)
+	out <- NULL
+	out$RES <- D[1]
+	out$ORGA <- D[2]
+	out$SIZE <- N
+	out$COMP <- Ni
+	return(out)
 }
 
 sortmat.byspe <- function(mat,spe)

Modified: pkg/ESM/man/GDS.Rd
===================================================================
--- pkg/ESM/man/GDS.Rd	2009-11-10 16:38:03 UTC (rev 5)
+++ pkg/ESM/man/GDS.Rd	2009-11-11 19:59:18 UTC (rev 6)
@@ -2,7 +2,7 @@
 \Rdversion{1.1} 
 \alias{GDS} 
 \title{Descriptive statistics}
-\description{Print basic description of a dataset}
+\description{Return a list with basic description of a dataset}
 \usage{ 
 GDS(mat)
 }
@@ -12,5 +12,8 @@
 }
 
 \value{
-	\item{}{Print the number of organisms, resources, interactions, and the fraction of interactions >0.}
+	\item{RES}{number of resources}
+	\item{ORGA}{number of organisms}
+	\item{SIZE}{number of interactions}
+	\item{COMPL}{proportion of interactions <0}
 }



More information about the Esm-commits mailing list