transpose: Transposing annmatrix Objects

transposeR Documentation

Transposing annmatrix Objects

Description

Transpose annmatrix along with the associated row and column annotations.

Usage

## S3 method for class 'annmatrix'
t(x)

Arguments

x

annmatrix object.

Value

transposed annmatrix object with appropriately adjusted row and column annotations.

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)

# transposes the main matrix along with row and column annotations
Xt <- t(X)

print(X)
print(Xt)

X@chr
Xt$chr


KKPMW/annmatrix documentation built on May 19, 2023, 3:34 a.m.