rcmb <- c(NA,0.10,0.05,0.10,NA,0.06,0.05,0.06,NA)
rcmb_mat <- matrix(rcmb,nrow=3,ncol=3,byrow=TRUE) # hypothetical recombination fraction matrix
colnames(rcmb_mat) <- rownames(rcmb_mat) <- paste("M",1:3,sep="")
rcmb_mat # not monotonic
order <- rcd(rcmb_mat)
order
rcmb_mat[order,order] # monotonic
Run the code above in your browser using DataLab