[Vegan-commits] r2564 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 14 14:01:51 CEST 2013


Author: jarioksa
Date: 2013-07-14 14:01:51 +0200 (Sun, 14 Jul 2013)
New Revision: 2564

Modified:
   pkg/vegan/R/betadiver.R
Log:
betadiver(help=TRUE) lines wrap more nicely

Modified: pkg/vegan/R/betadiver.R
===================================================================
--- pkg/vegan/R/betadiver.R	2013-07-14 07:26:37 UTC (rev 2563)
+++ pkg/vegan/R/betadiver.R	2013-07-14 12:01:51 UTC (rev 2564)
@@ -11,8 +11,8 @@
     }
     beta <- list("w"="(b+c)/(2*a+b+c)", "-1"="(b+c)/(2*a+b+c)", "c"="(b+c)/2",
                  "wb"="b+c", "r"="2*b*c/((a+b+c)^2-2*b*c)",
-                 "I"="log(2*a+b+c)-2*a*log(2)/(2*a+b+c)-((a+b)*log(a+b)+(a+c)*log(a+c))/(2*a+b+c)",
-                 "e"="exp(log(2*a+b+c)-2*a*log(2)/(2*a+b+c)-((a+b)*log(a+b)+(a+c)*log(a+c))/(2*a+b+c))-1",
+                 "I"="log(2*a+b+c) - 2*a*log(2)/(2*a+b+c) - ((a+b)*log(a+b) + (a+c)*log(a+c)) / (2*a+b+c)",
+                 "e"="exp(log(2*a+b+c) - 2*a*log(2)/(2*a+b+c) - ((a+b)*log(a+b) + (a+c)*log(a+c)) / (2*a+b+c))-1",
                  "t"="(b+c)/(2*a+b+c)", "me"="(b+c)/(2*a+b+c)",
                  "j"="a/(a+b+c)", "sor"="2*a/(2*a+b+c)",
                  "m"="(2*a+b+c)*(b+c)/(a+b+c)",
@@ -27,8 +27,9 @@
                  "z"="(log(2)-log(2*a+b+c)+log(a+b+c))/log(2)"
                  )
     if (help) {
-        for (i in 1:length(beta))
-            cat(i, " \"", names(beta[i]),"\" = ", beta[[i]], "\n", sep="")
+        for (i in 1:length(beta)) 
+            writeLines(strwrap(paste(i, " \"", names(beta[i]),
+                                     "\" = ", beta[[i]], "\n", sep="")))
         return(invisible(NULL))
     }
     x <- ifelse(x > 0, 1, 0)



More information about the Vegan-commits mailing list