powered by
upper(d)
inds <- upper(5) vals <- matrix(runif(25), nrow=5) selvals <- vals[inds] # vector containing the values of the upper triangle
Run the code above in your browser using DataLab