View source: R/compareCompositionPlot.R
compareCompositionPlot | R Documentation |
Plot the composition of a data set (e.g., the number of cells from each cell type) and contrast it with the corresponding composition of a subset.
compareCompositionPlot(
df,
idx,
column,
showPercentages = TRUE,
fontSizePercentages = 4
)
df |
A |
idx |
A numeric vector representing the row indexes of |
column |
A character scalar corresponding to a column of
|
showPercentages |
Logical scalar, indicating whether relative frequencies of each category should be shown in the plot. |
fontSizePercentages |
Numerical scalar, indicating the font size
of the relative frequencies, if |
A ggplot
object.
Charlotte Soneson
df <- data.frame(celltype = sample(LETTERS[1:5], 1000, replace = TRUE,
prob = c(0.1, 0.2, 0.5, 0.05, 0.15)))
idx <- sample(seq_len(1000), 200)
compareCompositionPlot(df, idx, "celltype")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.