Skip to contents

Plots the specified traces from a list of chromatograms.

Usage

plot_chroms(
  x,
  lambdas,
  idx,
  xlim,
  ylim,
  xlab = "",
  ylab = "Absorbance",
  engine = c("base", "ggplot", "plotly"),
  linewidth = 1,
  show_legend = TRUE,
  legend_position = "topright",
  ...
)

Arguments

x

A list of chromatograms in matrix format (timepoints x wavelengths).

lambdas

The wavelength(s) you wish to plot the trace at.

idx

A vector representing the names or numerical indices of the chromatograms to plot.

xlim

Range of x axis.

ylim

Range of y axis.

xlab

X label.

ylab

Y label. Defaults to "Absorbance".

engine

Plotting engine. Either base (matplot), plotly, or ggplot2-package.

linewidth

Line width.

show_legend

Logical. Whether to display legend or not. Defaults to TRUE.

legend_position

Position of legend.

...

Additional arguments to plotting function specified by engine.

Value

No return value, called for side effects.

Side effects

Plots the traces of the specified chromatograms idx at the specified wavelengths lambdas. Plots can be produced using base graphics, ggplot2, or plotly, according to the value of engine.

Author

Ethan Bass

Examples

data(Sa_pr)
plot_chroms(Sa_pr, idx = c(1:2), lambdas = c(210))