# 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
Run the code above in your browser using DataLab