Learn R Programming

biganalytics (version 1.1.1)

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)

## S3 method for class 'big.matrix': colmin(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': min(x, ..., na.rm = FALSE)

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

## S3 method for class 'big.matrix': colmax(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': max(x, ..., na.rm = FALSE)

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

## S3 method for class 'big.matrix': colprod(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': prod(x, ..., na.rm = FALSE)

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

## S3 method for class 'big.matrix': colsum(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': sum(x, ..., na.rm = FALSE)

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

## S3 method for class 'big.matrix': colrange(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': range(x, ..., na.rm = FALSE)

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

## S3 method for class 'big.matrix': colmean(x, cols = NULL, na.rm = FALSE)

## S3 method for class 'big.matrix': mean(x, ...)

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

## S3 method for class 'big.matrix': colvar(x, cols = NULL, na.rm = FALSE)

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

## S3 method for class 'big.matrix': colsd(x, cols = NULL, na.rm = FALSE)

colna(x, cols = NULL)

## S3 method for class 'big.matrix': colna(x, cols = NULL)

## S3 method for class 'big.matrix': summary(object)

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.
object
a big.matrix object.
...
options associated with the correspoding default Rfunction.

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).

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