Cell-to-sample mappings

cell2sample(object, ...)

# S4 method for SingleCellExperiment
cell2sample(object, return = c("factor", "DataFrame", "tbl_df"))

Arguments

object

Object.

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

...

Additional arguments.

Value

  • "factor": Named factor containing as the levels and cell IDs as the names.

  • DataFrame: Data frame containing sampleID column and cell identifiers as the row names.

  • "tbl_df": Tibble containing cellID and sampleID columns.

Note

sampleID column must be defined in colData().

Updated 2019-08-22.

Examples

data(SingleCellExperiment, package = "acidtest") sce <- SingleCellExperiment ## SingleCellExperiment ==== x <- cell2sample(sce) table(x)
#> x #> sample1 sample2 #> 49 51