replace_values {mosbi}R Documentation

Replace values in an integer adjacency matrix.

Description

Replace values in an integer matrix, that are lower than a certain threshold.

Usage

replace_values(mat, threshold, replace_higher = TRUE)

Arguments

mat

An integer matrix

threshold

All values in the matrix lower than this values are replaced by 0.

replace_higher

If set to true, all values >= threshold are replaced by 1.

Value

An integer matrix with (partially) replaced values.

Examples

replace_values(matrix(seq(1, 16), nrow=4), threshold=4)


[Package mosbi version 1.0.0 Index]