dsm_mask: Mask disimilarity matrix with NAs for the off-diagonal...

View source: R/dsm_mask.R

dsm_maskR Documentation

Mask disimilarity matrix with NAs for the off-diagonal elements

Description

This function will subsitute NAs in the off diagonal elements of a dissimilarity matrix. Will output melted matrix for convienent ggploting, or can simply mask an existing matrix.

Usage

dsm_mask(dsm, lower = FALSE, melt = TRUE)

Arguments

dsm

a single matrix

lower

logical indicating selection of lower or upper diagonal

melt

logical indicating whether or not to melt the matrix into a data frame

Author(s)

Robert S. Chavez

Examples

cars_dsm <- 1-cor(mtcars)
dsm_mask(cars_dsm)

chavezlab/csnl documentation built on June 12, 2022, 10:09 a.m.