powered by
vec2diag
vec2diag(x)
diag
diag2vec
vec2diag(matrix(1:4, 1, 4)) vec2diag(matrix(1:4, 4, 1))
Run the code above in your browser using DataLab