Learn R Programming

pbdDMAT (version 0.4-2)

ddmatrix-sumstats: Basic Summary Statistics

Description

Get basic summary statistics.

Usage

# S4 method for ddmatrix
sum(x, ..., na.rm = FALSE)

# S4 method for ddmatrix mean(x, na.rm = FALSE)

# S4 method for ddmatrix prod(x, na.rm = FALSE)

# S4 method for ddmatrix min(x, na.rm = FALSE)

# S4 method for ddmatrix max(x, na.rm = FALSE)

# S4 method for ddmatrix median(x, na.rm = FALSE)

Arguments

x

numeric distributed matrix

...

Additional arguments.

na.rm

Handling of NA's.

Value

A single value, owned by all ranks in the MPI communicator.

Details

The return is on process 0 only.

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

library(pbdDMAT, quiet = TRUE)
init.grid()

# don't do this in production code
x <- matrix(1:16, ncol=4)
dx <- as.ddmatrix(x) 

summary(dx)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab