View source: R/visualization.R
plotProportionBox | R Documentation |
This function calculate the proportion of each category (e.g. cluster, cell type) within each dataset, and then make box plot grouped by condition. The proportion of all categories within one dataset sums up to 1. The condition variable must be a variable of dataset, i.e. each dataset must belong to only one condition.
plotProportionBox(
object,
useCluster = NULL,
conditionBy = NULL,
sampleBy = "dataset",
splitByCluster = FALSE,
dot = FALSE,
dotSize = getOption("ligerDotSize", 1),
dotJitter = FALSE,
...
)
object |
A liger object. |
useCluster |
Name of variable in |
conditionBy |
Name of the variable in |
sampleBy |
Name of the variable in |
splitByCluster |
Logical, whether to split the wide grouped box plot by
cluster, into a list of boxplots for each cluster. Default |
dot |
Logical, whether to add dot plot on top of the box plot. Default
|
dotSize |
Size of the dot. Default uses user option "ligerDotSize", or
|
dotJitter |
Logical, whether to jitter the dot to avoid overlapping
within a box when many dots are presented. Default |
... |
Arguments passed on to
|
A ggplot object or a list of ggplot objects if
splitByCluster = TRUE
.
# "boxes" are expected to appear as horizontal lines, because there's no
# "condition" variable that groups the datasets in the example object, and
# thus only one value exists for each "box".
plotProportionBox(pbmcPlot, conditionBy = "dataset")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.