subset.gct {cmapR} | R Documentation

## Subset a gct object using the provided row and column ids

### Description

Subset a gct object using the provided row and column ids

### Usage

    ## S3 method for class 'gct'
    subset(...)

    subset_gct(g, rid = NULL, cid = NULL)

    ## S4 method for signature 'GCT'
    subset_gct(g, rid = NULL, cid = NULL)

### Arguments

`...` | arguments passed on to `subset_gct`
`g` | a gct object
`rid` | a vector of character ids or integer indices for ROWS
`cid` | a vector of character ids or integer indices for COLUMNS

### Value

a GCT object

### See Also

Other GCT utilities: `annotate.gct()`, `melt.gct()`, `merge.gct()`, `rank.gct()`

### Examples

    # first 10 rows and columns by index
    (a <- subset_gct(ds, rid=1:10, cid=1:10))

    # first 10 rows and columns using character ids
    # use \code{ids} to extract the ids
    rid <- ids(ds)
    cid <- ids(ds, dimension="col")
    (b <- subset_gct(ds, rid=rid[1:10], cid=cid[1:10]))

    identical(a, b) # TRUE

[Package cmapR version 1.6.0 Index]