R/na.zero.R

Defines functions na.zero

Documented in na.zero

#' na.zero
#'
#' Sets NAs to zero.
#'
#' @param x A numeric vector. No test that x is numeric.
#'
#' @return Vector of length of x, but with NA's replaced by 0.
#'
#' @examples
#' na.zero(c(1, NA))
#'
#' @export
na.zero <- function(x)
{
  x[is.na(x)] <- 0
  x
}
nextpagesoft/hivEstimatesAccuracy documentation built on Sept. 17, 2024, 5 a.m.