median center normalization

## by row
medianCenter <- function(y){
  y <- apply(y, 1, function(x){x-median(x)})
  scale(t(y), center=FALSE)
}

## by col
medianCenter <- function(y){
  y <- apply(y, 2, function(x){x-median(x)})
  scale(y, center=FALSE)
}

Leave a Reply

  

  

  

%d 博主赞过: