Skip to contents

Replaces NA values found in a vector with a specified scalar value

NOTE: The dplyr::coalesce() function now provides this functionality in a more general way, so this function may merit deprecation.

Usage

na_replace(x, replace)

Arguments

x

Vector possibly containing missing (NA) values.

replace

Scalar replacement value.

Value

Copy of x with any missing values replaced with replace.

See also

Other functions for NA handling: na_if_in()