Learn R Programming

pbdDMAT (version 0.4-2)

isdot: Type Checks, Including NA, NaN, etc.

Description

Functions to check for various types.

Usage

is.ddmatrix(x)

# S4 method for ddmatrix is.na(x)

# S4 method for ddmatrix is.nan(x)

# S4 method for ddmatrix is.numeric(x)

# S4 method for ddmatrix is.infinite(x)

Arguments

x

numeric distributed matrix

Value

Returns boolean in the case of is.numeric() and is.ddmatrix(), otherwise a distributed matrix.

Details

Performs the appropriate type check.

Examples

Run this code
# NOT RUN {
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

suppressPackageStartupMessages(library(pbdDMAT, quiet=T))

init.grid()

comm.set.seed(seed=1234, diff=TRUE)

x <- ddmatrix("rnorm", 5, 5, bldim=2)
test <- comm.any(is.na(x))
comm.print(test)

x[1,1] <- NA
test <- comm.any(is.na(x))
comm.print(test)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab