highlight_sample: Highlight Sample Spectra

View source: R/manipulations.R

highlight_sampleR Documentation

Highlight Sample Spectra

Description

Highlight one or more sample spectra on a spectral image. Changes all un-selected sample_ids to grey lines. Requires gghighlight::gghighlight() to function.

Surligne un ou plusieurs spectres d'échantillons sur une image spectrale. Change tous les spectres sample_ids non sélectionnés en lignes grises. Nécessite gghighlight::gghighlight() pour fonctionner.

Usage

highlight_sample(ftir_spectra_plot, sample_ids, ...)

Arguments

ftir_spectra_plot

A plot generated by plot_ftir() or plot_ftir_stacked().

Un tracé généré par plot_ftir() ou plot_ftir_stacked().

sample_ids

A vector of one or more sample_ids from the ftir_spectra_plot to highlight.

Un vecteur d'un ou plusieurs sample_ids du ftir_spectra_plot à souligner.

...

Additional parameters to pass to gghighlight::gghighlight().

Paramètres supplémentaires à passer à gghighlight::gghighlight().

Value

the FTIR plot as a ggplot2 object, with selected sample spectra highlighted.

le tracé FTIR en tant qu'objet ggplot2, avec les spectres de l'échantillon sélectionné soulignier.

See Also

gghighlight::gghighlight()

Examples

if (requireNamespace("ggplot2", quietly = TRUE) & requireNamespace("gghighlight", quietly = TRUE)) {
  # Generate a plot
  p <- plot_ftir(sample_spectra)

  # Highlight one sample:
  highlight_sample(p, "isopropanol")
}

PlotFTIR documentation built on April 13, 2025, 5:11 p.m.