mu.GE {muStat} | R Documentation |
mu.GE
returns a matrix with each element denoting the logical
value if one value is greater than or equal to another.
mu.GE(x, y=x)
x |
data matrix, variables as columns |
y |
second data matrix, optional |
The (i,j) entry of GE matrix is 1 if
x_i >= y_j
, 0 otherwise.
The square matrix GE is stored by column in a vector.
a vector which contains the GE matrix.
mu.GE <- function(x, y=x) { <...> if (length(y)>1) apply(rbind(x,y),2,mu.GE,nrow(x)) else as.numeric(NAtoZer(outer(x[1:y],x[-(1:y)],">="))) }
Knut M. Wittkowski kmw@rockefeller.edu, Tingting Song ttsong@gmail.com
a <- c(4, 2, 5, 1, 4, NA, 6) mu.GE(a)