replace_na {mltools}R Documentation

Replace NA Values

Description

Convenience method for returning a copy of a vector such that NA values are substituted with a replacement value

Usage

replace_na(x, repl = "auto")

Arguments

x

vector of values

repl

what to substitute in place of NAs

Details

Returns a copy of x such that NAs get replaced with a replacement value. Default replacement value is 0.

Examples

replace_na(c(1, NA, 1, 0))


[Package mltools version 0.3.5 Index]