R/na.replace.R

na.replace <- function(x, replace, ...)
{
  if(is.function(replace))
    replace <- replace(x, ...)
  
  x[is.na(x)] <- replace
  x
}

Try the gtools package in your browser

Any scripts or data that you put into this service are public.

gtools documentation built on May 2, 2019, 4:52 p.m.