R/replace_func.R

Defines functions replace_func

Documented in replace_func

#' Replace NAs with another value
#'
#' @param val The values in which to look for NAs
#' @param replace The value to replace the NAs in val
#'
#' @return The values with NAs replaced
#' @export
replace_func = function(val, replace) {
  ifelse(is.na(val), replace, val)
}
LisaHopcroft/CTutils documentation built on Oct. 7, 2021, 11:08 p.m.