hist_sample_num {MatrixQCvis}R Documentation

Return the number of a category

Description

'hist_sample_num' returns the number of a category (e.g. sample types) as a 'tbl'. The function will retrieve first the column 'category' in 'colData(se)'. The function will return a 'tbl' containing the numerical values of the quantities.

Usage

hist_sample_num(se, category = "type")

Arguments

se

'SummarizedExperiment' object

category

'character', corresponding to a column in 'colData(se)'

Value

'tbl'

Examples

## create se
a <- matrix(1:100, nrow = 10, ncol = 10, 
            dimnames = list(1:10, paste("sample", 1:10)))
a[c(1, 5, 8), 1:5] <- NA
set.seed(1)
a <- a + rnorm(100)
cD <- data.frame(name = colnames(a), type = c(rep("1", 4), rep("2", 6)))
rD <- data.frame(spectra = rownames(a))
se <- SummarizedExperiment::SummarizedExperiment(assay = a, 
    rowData = rD, colData = cD)

hist_sample_num(se, category = "type")


[Package MatrixQCvis version 1.2.2 Index]