Streamlining spectral data processing and modeling for spectroscopy applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.2 KiB

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot-spc-extended.R
\name{plot_spc_ext}
\alias{plot_spc_ext}
\title{ggplot2 wrapper for extended spectra plotting}
\usage{
plot_spc_ext(
spc_tbl,
spc_tbl_l = NULL,
lcols_spc = "spc",
lcol_measure = NULL,
lcol_measure_col_palette = "Spectral",
lcol_measure_col_direction = -1,
spc_id = "unique_id",
group_id = "sample_id",
group_id_order = TRUE,
group_color = TRUE,
group_color_palette = NULL,
group_panel = TRUE,
group_legend = FALSE,
ncol = NULL,
relabel_spc = TRUE,
ylab = "Spectrum value",
alpha = 0.5,
line_width = 0.2,
...
)
}
\arguments{
\item{spc_tbl}{Tibble data frame containing spectra, x-axis values, metadata
and eventual measured variables as list-columns.}
\item{spc_tbl_l}{List of spectral tibbles (data frames). Default is
\code{NULL} (argument is not used).}
\item{lcols_spc}{Character vector of spectral list-columns to be extracted.
Default is \code{"spc"} (raw spectra).}
\item{lcol_measure}{Character vector of length 1 denoting the column name
of the measure columns. This argument is optional. Default is \code{NULL},
which does not extract an additional measure column.}
\item{lcol_measure_col_palette}{Palette value supplied to
\code{ggplot::scale_colour_brewer()}. Default is \code{"Spectral"}, but you can set
it to the default argument \code{1} (will use
\code{scale_colour_brewer(..., palette = 1)}).}
\item{lcol_measure_col_direction}{Sets the the order of colours in the scale
that is based on a measure column. Default is \code{-1} which reverses the
scale. Argument is passed on to the function \code{ggplot2::sclae_colour_brewer()}
as argument \code{direction}.}
\item{spc_id}{Character vector denoting column name for a unique spectrum ID.
Default is \code{"unique_id"}.}
\item{group_id}{Character vector denoting column name for the spectrum group
ID. Default is \code{"sample_id"}. The group ID is used for
plotting spectra by group (e.g. by using different colors or panels).}
\item{group_id_order}{Logical that specifies whether the panel names
derived from a numeric \code{group_id} column are reordered using ascending
numbers. Default is \code{TRUE}.}
\item{group_color}{Logical defining whether spectra are colored by the column
specified by \code{group_id}.}
\item{group_color_palette}{Character (1L) defining the diverging colour
scales from colorbrewer.org; see \code{?scale_colour_brewer} for supported
diverging colur types (\code{palette} argument).}
\item{group_panel}{Logical defining whether spectra are arranged into panels
by groups specified in \code{group_id}. Default is \code{TRUE}.}
\item{group_legend}{Logical defining whether a legend for the \code{group_id}
is plotted. Default is \code{FALSE}.}
\item{ncol}{Integer vector of length 1. Defines number of columns when
plotting panels (facets). Default is \code{NULL} (argument not used).}
\item{relabel_spc}{Logical defining whether panels are relabeled with custom
names for spectra types. Default is TRUE. When \code{TRUE}, arguments
from \code{relabel_spc_types} can be passed to \code{plot_spc_ext}
(supported via the \code{...} (ellipsis) argument)}
\item{ylab}{Character vector or vector of type \code{"expression"} created by
mathematical expression created by \code{expression}. Custom annotation for
y-axis of spectra}
\item{alpha}{Integer of length 1, from 0 to 1. Defines transparency of
spectral lines. Default is \code{0.5} (0 is completely transparent and
1 is no transparency).}
\item{line_width}{Numeric vector of length 1 specifying the width of the
spectral lines. Default is \code{0.2}.}
\item{...}{Further arguments to be passed to \code{plot_spc_ext}. Currently,
arguments of \code{relabel_spc_types} are supported.}
}
\value{
Object of class \code{"ggplot"} (ggplot2 graph).
}
\description{
\code{plot_spc_ext} is a custom plotting function developed
within the simplerspec framework. Returns plots based on ggplot2
(class "ggplot"). Different spectra types such as raw or preprocessed spectra
and groups can be differentiated by different colors or by using panels
(so called facets). Additionally, spectra can be colored based on an
additional measure variable, e.g. determined by chemical reference analysis.
}