# NOT RUN {
set.seed(1)
x <- matrix(c(rep(1,3), rep(2,3),rep(3,3), rep(4,3)),3,4)
## columnwise:
normalizeMatrix(x, ymin=0, ymax=1)
## rowwise
normalizeMatrix(x, ymin=0, ymax=1, MARGIN=1)
# rows with identical values are mapped to the mean:
x <- matrix(rep(0,4),2,2)
normalizeMatrix(x, ymin=0, ymax=1)
# }
Run the code above in your browser using DataLab