Special-Value-Replacement: NA, Inf, and NaN replacement.

Description Usage Arguments Details Value

Description

Replace NA, Inf, and NaN values in single vectors.

Usage

1
2
3
4
5
NA2(x, replacement)

Inf2(x, replacement)

NaN2(x, replacement)

Arguments

x

The vector in which to replace the special value.

replacement

The replacement value.

Details

dplyr::coalesce has similar functionality, but is meant to deal with parallel vectors (similar to many SQL-systems's COALESCE function). These calls are simpler and are only intended to replace values in basic vectors. NA2 uses is.na, Inf2 uses is.infinite, and NaN2 uses is.nan as the predicate function.

Value

A new vector with the special value replaced by the replacement value.


mmuurr/zzz documentation built on May 14, 2019, 12:46 p.m.