seqplots-generic {seqplots} | R Documentation

## SeqPlots generic methods

### Description

Generic operators working with `PlotSetArray`, `PlotSetList` and `PlotSetPair` to subset or flatten the data structure.

### Usage

    ## S4 method for signature 'PlotSetList,ANY,ANY,ANY'
    x[i, j, ..., drop = TRUE]

    ## S4 method for signature 'PlotSetList,ANY,ANY'
    x[[i, j, ...]]

    ## S4 method for signature 'PlotSetArray,ANY,missing,ANY'
    x[i, j, ..., drop = TRUE]

    ## S4 method for signature 'PlotSetArray,ANY,vector,ANY'
    x[i, j]

    ## S4 method for signature 'PlotSetArray,ANY,ANY'
    x[[i, j, ...]]

### Arguments

`x` | an object of class `PlotSetArray`, `PlotSetList` or `PlotSetPair`
`i` | indices specifying elements to extract or replace. Indices are `numeric` or `character` vectors or empty (missing) or `NULL`. Numeric values are coerced to integer as by `as.integer` (and hence truncated towards zero). Character vectors will be matched to the `names` of the object (or for matrices/arrays, the `dimnames`): see ‘Character indices’ below for further details. For `[`-indexing only: `i`, `j`, `...` can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. `i`, `j`, `...` can also be negative integers, indicating elements/slices to leave out of the selection. When indexing arrays by `[` a single argument `i` can be a matrix with as many columns as there are dimensions of `x`; the result is then a vector with elements corresponding to the sets of indices in each row of `i`. An index value of `NULL` is treated as if it were `integer(0)`.
`j` | see description for `i`
`...` | see description for `i`
`drop` | For matrices and arrays. If `TRUE` the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement. See `drop` for further details.

### Value

If `x` is `PlotSetArray` class:

- `x[1:2,1:2]` produces `PlotSetArray` with 2 feature(s) and 2 tracks.

- `x[1:2]` produces `PlotSetList` with 2 feature/tracks pairs.

- `x[[1]]` produces single `PlotSetPair`.

- `x$as.array()` produces the matrix of `PlotSetPair` classes with all feature/tracks pairs.

If `x` is `PlotSetList` class:

- `x[1:2]` produces `PlotSetList` with 2 feature/tracks pairs.

- `x[[1]]` produces single `PlotSetPair`.

### See Also

`Extract`

[Package seqplots version 1.22.2 Index]