get_triangle: Get Lower or Upper Triangle of Correlations Matrix

Description Usage Arguments Details Value Examples

View source: R/get-triangle.R

Description

A simple function returning upper or lower matrix triangle. Remaining triangle is replaced with NAs.

Usage

1
get_triangle(cormat, part = "upper")

Arguments

cormat

Usually correlation matrix

part

Single string vector decide whether to return upper or lower part.

Details

The functions as a wrapper on lower.tri and upper.tri functions.

Value

Object of dimensions dim(cormat) with NA values being present in lower or upper triangle.

Examples

1
2
M <- matrix(1:20, 5, 5)
get_triangle(cormat = M, part = "upper")

konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.