Replace Missing Values

Description

Replace missing values

Usage

1

Arguments

x

vector possibly contining missing (NA) values.

replace

scalar replacement value

Details

This is a convenience function that is the same as x[is.na(x)] <- replace

Value

Vector with missing values (NA) replaced by the value of replace.

Author(s)

Gregory R. Warnes greg@warnes.net

See Also

is.na, na.omit

Examples

1
2
   x <- c(1,2,3,NA,6,7,8,NA,NA)
   na.replace(x, '999')

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.