Simple plotting interface for spc datasets created with OPUSraw_to_preprocessed(). Note: Large amount of spc might be laggy. Subset data beforehand or set sample size to smaller number for random sampling. [Experimental]

spectra_plotter(
  dataset,
  spc_id = "spc_rs",
  sample_size = nrow(dataset),
  interactive = F,
  reverse_x = T,
  col_var = "ID",
  leg_pos = "none"
)

Arguments

dataset

a spc dataset, as created by OPUSraw_to_Preprocessed

spc_id

The id of the nested spc matrix. Choose from c("spc","spc_rs","spc_sg","spc_sg_bl", "spc_sg_bl_rs4","spc_sg_snv","spc_sg_snv_rs4")

sample_size

How many spectra should be plotted? Default is all. If lower than nrow(dataset), spc are sampled randomly. To select specific spc, filter dataset beforehand.

interactive

logical: If TRUE, a ggplotly interactive plot will be created.

reverse_x

logical: If TRUE, x-axis will be plotted in reverse (decending wavenumber)

col_var

str to selcet variable column for spc coloring

leg_pos

legend position arg. handed to ggplot legend.position