metaLevels {dittoSeq} | R Documentation

## Gives the distinct values of a meta.data slot (or ident)

### Description

Gives the distinct values of a meta.data slot (or ident)

### Usage

    metaLevels(meta, object, cells.use = NULL, used.only = TRUE)

### Arguments

`meta` | quoted "meta.data.slot" name = REQUIRED. the meta.data slot whose potential values should be retrieved.
`object` | A target Seurat or SingleCellExperiment object
`cells.use` | String vector of cells'/samples' names which should be included. Alternatively, a Logical vector, the same length as the number of cells in the object, which sets which cells to include. For the typically easier logical method, provide `USE` in `object@cell.names[USE]` OR `colnames(object)[USE]`).
`used.only` | TRUE by default, whether unused levels of already

### Value

Returns the distinct values of a metadata slot (factor or not) among to all cells/samples, or for a subset of cells/samples. (Alternatively, returns the distinct values of clustering if `meta = "ident"` and the object is a `Seurat` object).

### Author(s)

Daniel Bunis

### See Also

`meta` for returning an entire metadata slots of an `object`, not just the potential levels

`getMetas` for returning all metadata slots of an `object`

`isMeta` for testing whether something is the name of a metadata slot

### Examples

    # dittoSeq handles bulk and single-cell data quit similarly.
    # The SingleCellExperiment object structure is used for both,
    # but all functions can be used similarly directly on Seurat
    # objects as well.

    example(importDittoBulk, echo = FALSE)

    metaLevels("clustering", object = myRNA)

    # Note: Set 'used.only' (default = TRUE) to FALSE to show unused levels
    #  of metadata that are already factors.  By default, only the in use options
    #  of a metadata are shown.
    metaLevels("clustering", myRNA,
        used.only = FALSE)

[Package dittoSeq version 1.0.2 Index]