densityPlot | R Documentation |
Constructs a density plot for a calculated variable in e_meta
portion of ftmsData
object
densityPlot(
ftmsObj,
variable,
samples = NA,
groups = FALSE,
title = NA,
yaxis = "density",
plot_hist = FALSE,
plot_curve = TRUE,
curve_colors = NA,
hist_color = "gray",
xlabel = NA,
ylabel = paste0(toupper(substring(yaxis, 1, 1)), substring(yaxis, 2), sep = "")
)
ftmsObj |
ftmsData object of class peakData or compoundData |
variable |
column name of column in |
samples |
vector of sample names to plot. Default of |
groups |
vector of group names to plot. Value of |
title |
plot title, default is NA (no title) |
yaxis |
what should the y-axis represent, "density" or "count"? |
plot_hist |
TRUE/FALSE should a histogram be added to the plot? A histogram may only be added if a single sample or groups is plotted. |
plot_curve |
TRUE/FALSE should a smoothed curve be added to the plot? |
curve_colors |
named vector of colors for curves, where names correspond to samples or groups chosen. Named colors or hex codes are accepted. |
hist_color |
(single) color for histogram bars. Named colors or hex codes are accepted. |
xlabel |
x axis label, default is NULL, which will result in the same name as "variable" |
ylabel |
y axis label, default is "Density" |
If a histogram is produced, the histogram bar data as a data frame is attached to the output as the attribute hist_data
.
This may be useful for adding additional data to the plot, e.g. for linking selections in multiple plots.
a plotly object
Allison Thompson, Lisa Bramer, Amanda White
plot_ly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.