I have a nx1 matrix I want to convert this to a nxn diagonal matrix in R
If you just want to know how to do this in R, it's:
R
my.matrix <- matrix(0, nrow=4, ncol=4) diag(my.matrix) <- rep(0.25, 4)