old.par <- par(no.readonly = TRUE)
# create a square matrix
x <- matrix(runif(1600, 0, 1), 40, 40)
# fig 1
triangleplot(x)
# fig 2 assign cutting points
triangleplot(x, cutpts=c(0,0.25,0.5,0.75,1), digits=2)
# fig 3 if x contains missing value
x[12,13] <- x[13,12] <- NA
x[25,27] <- x[27,25] <- NA
triangleplot(x)
par(old.par)
Run the code above in your browser using DataLab