to_na: Replace NaN and Inf with NA

View source: R/to_na.R

to_naR Documentation

Replace NaN and Inf with NA

Description

Takes out NaN and Inf and replaces them with NA

Usage

to_na(x)

Arguments

x

a vector

Value

Returns vector with replaced NA values.

Author(s)

Daniel Luettgau

Examples

test <- list(a = c("a", "b", NA),
             b = c(NaN, 1,2, -Inf),
             c = c(TRUE, FALSE, NA))

lapply(test, to_na)

## Output
# $a
# [1] "a" "b" NA

# $b
# [1] NA  1  2 NA

# $c
# [1] TRUE FALSE NA


STATWORX/helfRlein documentation built on Feb. 12, 2024, 2:21 a.m.