dichotMat: Dichotomize a matrix

View source: R/dichotMat.r

dichotMatR Documentation

Dichotomize a matrix

Description

Make a binary matrix out of a weighted matrix

Usage

dichotMat(mat, min)

Arguments

mat

a numeric matrix

min

a threshold. All values in mat of at least this minimum value will become 1, all values smaller than this minimum will become 0.

Details

If a cell has value smaller than a minimum value, the cell becomes 0. If the cell has a value of at least the minimum value, it becomes 1. The procedure will work for any matrix, not necessarily a square one.

Value

the dichotomized matrix

Examples

M <- matrix(round(runif(20),1), ncol = 4)
dichotMat(M, min = .45)

SNAnalyst/DF21 documentation built on March 21, 2022, 12:02 a.m.