Learn R Programming

biganalytics (version 1.1.22)

colmin: Basic summary statistics for ``big.matrix'' objects

Description

Functions operate on columns of a big.matrix object

Usage

colmin(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colmin(x, cols = NULL, na.rm = FALSE)

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

colmax(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colmax(x, cols = NULL, na.rm = FALSE)

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

colprod(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colprod(x, cols = NULL, na.rm = FALSE)

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

colsum(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colsum(x, cols = NULL, na.rm = FALSE)

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

colrange(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colrange(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix range(x, ..., na.rm = FALSE)

colmean(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colmean(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix mean(x, ...)

colvar(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colvar(x, cols = NULL, na.rm = FALSE)

colsd(x, cols = NULL, na.rm = FALSE)

# S4 method for big.matrix colsd(x, cols = NULL, na.rm = FALSE)

colna(x, cols = NULL)

# S4 method for big.matrix colna(x, cols = NULL)

# S4 method for big.matrix summary(object)

Value

For colrange, a matrix with two columns and length(cols) rows; column 1 contains the minimum, and column 2 contains the maximum for that column. The other functions return vectors of length length(cols).

Arguments

x

a big.matrix object.

cols

a scalar or vector of column(s) to be summarized.

na.rm

if TRUE, remove NA values before summarizing.

...

options associated with the correspoding default R function.

object

a big.matrix object.

Details

These functions essentially apply summary functions to each column (or each specified column) of the big.matrix in turn.

Examples

Run this code
x <- as.big.matrix(
  matrix( sample(1:10, 20, replace=TRUE), 5, 4,
          dimnames=list( NULL, c("a", "b", "c", "d")) ) )
x[,]
mean(x)
colmean(x)
colmin(x)
colmin(x, 1)
colmax(x)
colmax(x, "b")
colsd(x)
colrange(x)
range(x)
colsum(x)
colprod(x)

Run the code above in your browser using DataLab