[Qca-commits] r45 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 17 20:40:22 CET 2014


Author: dusadrian
Date: 2014-12-17 20:40:22 +0100 (Wed, 17 Dec 2014)
New Revision: 45

Modified:
   pkg/R/retention.R
Log:
fixed a small bug on line 6

Modified: pkg/R/retention.R
===================================================================
--- pkg/R/retention.R	2014-12-17 11:05:16 UTC (rev 44)
+++ pkg/R/retention.R	2014-12-17 19:40:22 UTC (rev 45)
@@ -3,7 +3,7 @@
          assump = "independent", n.cut = 1, incl.cut = 1, p.pert = 0.1,
          n.pert = 1) {
     
-    names(mydata) <- toupper(names(data))
+    names(data) <- toupper(names(data))
     conditions <- toupper(conditions)
     outcome <- toupper(outcome)
     if (any(conditions == "")) {
@@ -74,7 +74,7 @@
                         combs <- combs*choose(cpos[pairsxl[l, j]], allpairs[i, l*2 - 1])
                         combs <- combs*choose(cneg[pairsxl[l, j]], allpairs[i, l*2])
                     }
-                    nofsetsxl <- nofsetsxl + combs*choose(nrow(dat) - sum(cposneg), n.pert - sum(allpairs[i, ]))
+                    nofsetsxl <- nofsetsxl + combs*choose(nrow(data) - sum(cposneg), n.pert - sum(allpairs[i, ]))
                 }
             }
         }
@@ -91,7 +91,7 @@
             nofsetsxl <- calculatePairs(i, n.pert, type = type)
             nofsets <- nofsets + ifelse(i %% 2 == 1, nofsetsxl, -1*nofsetsxl)
         }
-        return(as.vector(1 - nofsets/choose(nrow(dat), n.pert)))
+        return(as.vector(1 - nofsets/choose(nrow(data), n.pert)))
     }
     else if (assump == "independent") {
         pfinal <- 1



More information about the Qca-commits mailing list