View source: R/tab_samplesfeatures.R
hist_sample | R Documentation |
hist_sample
plots the number of a category (e.g. sample types)
as a histogram. It use the returned tbl
from hist_sample_num
.
hist_sample(tbl, category = "type")
tbl |
|
category |
|
gg
object from ggplot2
## create se
a <- matrix(seq_len(100), nrow = 10, ncol = 10,
dimnames = list(seq_len(10), paste("sample", seq_len(10))))
a[c(1, 5, 8), seq_len(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)
tbl <- hist_sample_num(se, category = "type")
hist_sample(tbl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.