plot_density | R Documentation |
This function displays each sample's omic data distribution as a density curve.
plot_density( dat, group = NULL, pal_group = "npg", xlab = NULL, title = "Density Plot", legend = "right", hover = FALSE )
dat |
Omic data matrix or matrix-like object with rows corresponding to
probes and columns to samples. Raw counts stored in |
group |
Optional character or factor vector of length equal to sample size. Numeric or logical vectors are silently coerced to factor. Levels are used to color density curves. If supplied, legend title defaults to "Group". Override this feature by passing a named list instead. |
pal_group |
String specifying the color palette to use if |
xlab |
Optional label for x-axis. |
title |
Optional plot title. |
legend |
Legend position. Must be one of |
hover |
Show sample name by hovering mouse over data point? If |
Density curves offer an intuitive way to visualize an omic data distribution.
They are common in quality control pipelines, and may be especially helpful
when contrasting pre- and post-normalization matrices. plot_density
can additionally be used to inspect for batch effects or associations with
phenotypic factors by using the group
argument.
plotDensities
# Density plots by sample mat <- matrix(rnorm(500 * 10), nrow = 500, ncol = 10) plot_density(mat) # Density plots by group grp <- rep(c("A", "B"), each = 5) plot_density(mat, group = grp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.