print {annmatrix}R Documentation

Print annmatrix Object

Description

Functions that print an annmatrix object

Usage

## S3 method for class 'annmatrix'
print(x, nrow = 5, ncol = 5, digits = getOption("digits"), ...)

Arguments

x

a matrix.

nrow

number of rows to display (default is 5).

ncol

number of columns to display (default is 5).

digits

number of digits to display (default set to getOptions("digits")).

...

further arguments passed to or from methods.

Details

annmatrix objects are printed in a shortened form (5 rows and 5 columns by default). In addition the function displays information about available meta-data for rows and columns.

Value

invisibly returns annmatrix object.

Author(s)

Karolis Koncevičius

Examples

# construct annmatrix object
x <- matrix(rnorm(20*10), 20, 10)

coldata <- data.frame(group  = rep(c("case", "control"), each = 5),
                      gender = sample(c("M", "F"), 10, replace = TRUE))

rowdata <- data.frame(chr = sample(c("chr1", "chr2"), 20, replace = TRUE),
                      pos = runif(20, 0, 1000000))

X <- annmatrix(x, rowdata, coldata)

print(X)
print(X, 10, 5)
print(X, 2, 2)

# also works with a list-based matrix
x <- matrix(list(mtcars, iris3, USAccDeaths, rivers), ncol=2)
print(x)
X <- annmatrix(x)
print(X)


[Package annmatrix version 0.1.2 Index]