Replace NAs in a numeric vector x with 0. This function has the same logic as the zeroifnull function in SQL.
NAIfZero() does replace zeros with
NAIfBlank() do the same, but for character vectors.
ZeroIfNA(x) NAIfZero(x) NAIf(x, what) BlankIfNA(x, blank="") NAIfBlank(x) Impute(x, FUN = function(x) median(x, na.rm = TRUE))
the vector x, whose NAs should be overwritten with 0s.
a character to be used for "blank". Default is an empty string ("").
a vector of elements to be set to
the name of a function to be used as imputation. Can as well be a self defined function or a constant value.
the edited vector x
Andri Signorell <email@example.com>