shortcuts: Convenient Functions to Access Annotations of annmatrix...

Description Usage Arguments Details Author(s) Examples

Description

Shortcuts to access and modify the row and column annotations of the annmatrix object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'annmatrix'
@(object, name)

## S3 replacement method for class 'annmatrix'
@(object, name) <- value

## S3 method for class 'annmatrix'
x$name

## S3 replacement method for class 'annmatrix'
x$name <- value

Arguments

name

a character string specifying the name of metadata to select or replace

value

newly assigned value to replace the field specified by name

x, object

R object

Details

@ selects the fields of row metadata data.frame

@<- replaces the fields of row metadata data.frame

$ selects the fields of column metadata data.frame

$<- replaces the fields of column metadata data.frame

Author(s)

Karolis Koncevičius

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
coldata <- data.frame(group=c(rep("case", 20), rep("control", 20)),
                      gender=sample(c("M", "F"), 40, replace=TRUE)
                      )
rowdata <- data.frame(chr=sample(c("chr1", "chr2"), 100, replace=TRUE),
                      pos=runif(100, 0, 1000000)
                      )
mat <- matrix(rnorm(100*40), 100, 40)
annMat <- annmatrix(mat, rowdata, coldata)

annMat$group
annMat@chr

annMat@newField <- 1:nrow(annMat)
annMat$newField <- 1:ncol(annMat)
annMat$newField
annMat$newField <- NULL
annMat$newField

KKPMW/annmatrix documentation built on May 27, 2019, 11:42 a.m.