R/is.na.R

Defines functions is.infinite.mcnode is.finite.mcnode is.nan.mcnode is.na.mcnode

Documented in is.finite.mcnode is.infinite.mcnode is.na.mcnode is.nan.mcnode

#' Finite, Infinite, NA and NaN Numbers in mcnode
#'
#' \samp{is.na}, \samp{is.nan}, \samp{is.finite} and \samp{is.infinite} return a logical
#' \samp{mcnode} of the same dimension as \samp{x}.
#'
#' @param x a \samp{mcnode} object.
#' @return a logical \samp{mcnode} object.
#' @seealso \code{\link{is.finite}}, \code{\link{NA}}
#' @keywords NA
#' @name NA.mcnode
#' @examples
#' x <- log(mcstoc(rnorm, nsv=1001))
#' x
#' is.na(x)
#' @export
is.na.mcnode <- function(x)
{
  y <- NextMethod()
  attr(y,"type") <- attr(x,"type")
  attr(y,"outm") <- attr(x,"outm")
  class(y) <- "mcnode"
  return(y)}

#' @rdname NA.mcnode
#' @export
is.nan.mcnode <- function(x)
{
  y <- NextMethod()
  attr(y,"type") <- attr(x,"type")
  attr(y,"outm") <- attr(x,"outm")
  class(y) <- "mcnode"
  return(y)}

#' @rdname NA.mcnode
#' @export
is.finite.mcnode <- function(x)
{
  y <- NextMethod()
  attr(y,"type") <- attr(x,"type")
  attr(y,"outm") <- attr(x,"outm")
  class(y) <- "mcnode"
  return(y)}

#' @rdname NA.mcnode
#' @export
is.infinite.mcnode <- function(x)
{
  y <- NextMethod()
  attr(y,"type") <- attr(x,"type")
  attr(y,"outm") <- attr(x,"outm")
  class(y) <- "mcnode"
  return(y)}

Try the mc2d package in your browser

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

mc2d documentation built on Oct. 23, 2026, 1:06 a.m.