Type Checks, Including NA, NaN, etc.

Share:

Description

Functions to check for various types.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
is.ddmatrix(x)

## S4 method for signature 'ddmatrix'
is.na(x)

## S4 method for signature 'ddmatrix'
is.nan(x)

## S4 method for signature 'ddmatrix'
is.numeric(x)

## S4 method for signature 'ddmatrix'
is.infinite(x)

Arguments

x

numeric distributed matrix

Details

Performs the appropriate type check.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## 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()

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.