R/isNA.R

#' @title 
#' Test if NA 
#' 
#' @description 
#' \code{isNA} tests if an object \code{x} is identical to one of \code{NA}, 
#' \code{NA_character_}, \code{NA_complex_}, \code{NA_integer_}, 
#' \code{NA_real_}, or \code{NaN}. 
#' 
#' @param x
#' An R object. 
#' 
#' @return 
#' \code{TRUE} or \code{FALSE}. 
#' 
#' @seealso 
#' \code{\link{isTRUE}}. 
#' 
#' @export
#' 
isNA <- 
function(x)
{
  identical(x, NA) || 
    identical(x, NA_character_) ||
    identical(x, NA_complex_) ||
    identical(x, NA_integer_) ||
    identical(x, NA_real_) ||
    identical(x, NaN)
}

Try the bazar package in your browser

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

bazar documentation built on May 2, 2019, 7:02 a.m.