zeroNa: Zero non finite values

Description Usage Arguments Value Examples

Description

This function replaces NA, Inf, -Inf, and NaN values of a matrix, array or vector with zero.

Usage

1
zeroNa(input)

Arguments

input

A numeric vector, matrix, or array. If an array it must have less than 5 dimensions.

Value

Returns the same input but with zeros in place of the non-finite values.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 test<-matrix(rnorm(100),10,10)

test[5,5]<-NA
test
zeroNa(test)

test[5,5]<-NaN
test
zeroNa(test)

test[5,5]<- -Inf
test
zeroNa(test)

test[5,5]<- +Inf
test
zeroNa(test)

FIACH documentation built on May 1, 2019, 8:02 p.m.

Related to zeroNa in FIACH...