naToVal: Replace NA with a user given value in a vector

Description Usage Arguments Value Examples

View source: R/valuefunctions.R

Description

This function replaces all NA's in a vector with a value provided by the user.

Usage

1
naToVal(x, y = 0)

Arguments

x

the vector to replace all NA in

y

the value to replace the NA with

Value

a new vector with all NA's replaced by y

Examples

1
2
naToZero(c(NA, 3:5, NA, NA, 4, 4, 10, NA))
naToVal(c(NA, 3:5, NA, NA, 4, 4, 10, NA), 0)

DoktorMike/datools documentation built on Feb. 28, 2021, 8:39 a.m.