replaceNaN_byname: Replace 'NaN' values with a value

View source: R/Unary.R

replaceNaN_bynameR Documentation

Replace NaN values with a value

Description

In a matrix or within matrices in a list, replace all NaN matrix values with val.

Usage

replaceNaN_byname(a, val = 0)

Arguments

a

A matrix of list of matrices in which NaN will be replaced by val.

val

NaNs are replace by val.

Value

A matrix or list of matrices in which all NaN are replaced by val.

Examples

suppressWarnings(a <- matrix(c(1, sqrt(-1))))
replaceNaN_byname(a)
replaceNaN_byname(a, 42)

matsbyname documentation built on Oct. 19, 2023, 5:11 p.m.