[Mattice-commits] r186 - in pkg: R misc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 27 03:32:47 CET 2009


Author: andrew_hipp
Date: 2009-02-27 03:32:47 +0100 (Fri, 27 Feb 2009)
New Revision: 186

Modified:
   pkg/R/regimes.R
   pkg/misc/oldRegimeMatrix.R
Log:
moving as.decimal from misc/oldRegimeMatrix.R to regimes.R -- still needed!

Modified: pkg/R/regimes.R
===================================================================
--- pkg/R/regimes.R	2009-02-27 02:29:53 UTC (rev 185)
+++ pkg/R/regimes.R	2009-02-27 02:32:47 UTC (rev 186)
@@ -156,4 +156,12 @@
   outmat <- rbind(outmat, rep(0,n))
   dimnames(outmat) = list(seq(dim(outmat)[1]), seq(dim(outmat)[2]))
   return(outmat)
-}
\ No newline at end of file
+}
+
+as.decimal <- function(n) {
+# takes a binary vector and makes it a decimal
+  digits <- length(n)
+  result <- 0
+  for(i in digits:1) result <- result + n[i] * 2 ^ (digits - i)
+  result
+}

Modified: pkg/misc/oldRegimeMatrix.R
===================================================================
--- pkg/misc/oldRegimeMatrix.R	2009-02-27 02:29:53 UTC (rev 185)
+++ pkg/misc/oldRegimeMatrix.R	2009-02-27 02:32:47 UTC (rev 186)
@@ -40,10 +40,3 @@
    return(out)
 }
 
-as.decimal <- function(n) {
-# takes a binary vector and makes it a decimal
-  digits <- length(n)
-  result <- 0
-  for(i in digits:1) result <- result + n[i] * 2 ^ (digits - i)
-  result
-}
\ No newline at end of file



More information about the Mattice-commits mailing list