R/dtNA0.R

Defines functions dtNA0

Documented in dtNA0

#' Replace NA in data table with 0
#' 
#' @param DT A data table to have NA replaced with 0.
#' @keywords data table, NA, replace, 0, zero
#' @export
#' @examples 
#' dtNA0()

dtNA0 <-  function(DT) {
  for (i in names(DT))
    DT[is.na(get(i)), (i):=0]
}
smmurphy/convenience documentation built on Aug. 26, 2020, 8:46 p.m.