Extract {iCOBRA} | R Documentation

## Subsetting `COBRAData`, `COBRAPerformance` or `COBRAPlot` objects

### Description

Functions to subset `COBRAData`, `COBRAPerformance` or `COBRAPlot` objects. `COBRAData` objects are subset by features (rows), while `COBRAPerformance` and `COBRAPlot` objects are subset by methods (columns). Numeric indices are not allowed, since not all slots may be arranged in the same order.

### Usage

    ## S4 method for signature 'COBRAData'
    x[i, j = "missing", drop = "missing"]

    ## S4 method for signature 'COBRAPerformance'
    x[i = "missing", j, drop = "missing"]

    ## S4 method for signature 'COBRAPlot'
    x[i = "missing", j, drop = "missing"]

### Arguments

`x` | A `COBRAData`, `COBRAPerformance` or `COBRAPlot` object.
`i` | For `COBRAData` objects, a character vector of feature names to retain.
`j` | For `COBRAPerformance` and `COBRAPlot` objects, a character vector with method names to retain.
`drop` | not used.

### Value

A subset of the original object, of the same class

### Examples

    data(cobradata_example)
    cobradata_example[c("ENSG00000000457", "ENSG00000000971",
                        "ENSG00000000460"), ]
    cobraperf <- calculate_performance(cobradata_example,
                                       binary_truth = "status",
                                       aspects = "fdrtpr")
    cobraperf[, c("voom")]
    cobraplot <- prepare_data_for_plot(cobraperf)
    cobraplot[, c("voom")]

[Package iCOBRA version 1.12.1 Index]