fix memory leaks on EMGLLF, test OK for EMGrank
[valse.git] / R / vec_bin.R
diff --git a/R/vec_bin.R b/R/vec_bin.R
deleted file mode 100644 (file)
index 27f771b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#' A function needed in initSmallEM
-#'
-#' @param X vector with integer values
-#' @param r integer
-#'
-#' @return a list with Z (a binary vector of size the size of X) and indices where Z is equal to 1
-vec_bin = function(X,r)
-{
-       Z = rep(0,length(X))
-       indice = c()
-       j = 1
-       for (i in 1:length(X))
-       {
-               if(X[i] == r)
-               {
-                       Z[i] = 1
-                       indice[j] = i
-                       j=j+1
-               } else
-                       Z[i] = 0
-       }
-       return (list(Z=Z,indice=indice))
-}