Learn R Programming

SimTimeVar (version 1.0.0)

upper_tri_vec: Turn symmetric matrix into vector

Description

An internal function not intended for the user. Turns a matrix into a vector of the upper-triangular elements (arranged by row).

Usage

upper_tri_vec(m)

Arguments

m

Matrix

Examples

Run this code
# NOT RUN {
# make a simple correlation matrix
x = rnorm(10); y = rnorm(10); z = rnorm(10)
mat = cor( data.frame(x,y,z) )

# turn into into vector
upper_tri_vec(mat)
# }

Run the code above in your browser using DataLab