qplot_kAmp: [!+] Plot amplitudes (a.k.a scores) of spectroscopic...

View source: R/qplot_kAmp.R

qplot_kAmpR Documentation

[!+] Plot amplitudes (a.k.a scores) of spectroscopic components

Description

Plot amplitudes (a.k.a scores) of spectroscopic components grouped by categorical variable by. Amplitudes are provided as hyperSpec object.

Usage

qplot_kAmp(
  scores,
  Title = "Component amplitudes",
  subTitle = NULL,
  xLabel = labels(scores, ".wavelength"),
  yLabel = labels(scores, "spc"),
  by = "gr",
  palette = hyGet_palette(scores),
  add.violin = TRUE,
  add.jitter = FALSE,
  add.boxplot = TRUE,
  violin.alpha = 0.25,
  jitter.alpha = 0.3,
  jitter.size = 1
)

qplot_scores(..., by = NULL, add.violin = FALSE)

Arguments

scores

An object of class hyperSpec with factor scores, principal component scores, component amplitudes, etc.

Title

The main title for the plot.

subTitle

The second line of title, which will be smaller and and in italics.

xLabel

A label for abscisa (x) axis.

yLabel

A label for ordinate (y) axis.

by

A name of grouping variable. If NULL, all data is ploted. Default is by = "gr" for qplot_kAmp and by = NULL for qplot_scores.

palette

A color palette to be used in plotting. (...)

add.violin

Logical. If TRUE adds so called violin (i.e., symmetrical probarility density) plot. Default is TRUE for qplot_kAmp.

add.jitter

Logical. If TRUE adds jitter plot. Default is FALSE.

add.boxplot

Logical. If TRUE adds boxplot. Default is TRUE.

violin.alpha

Transperency of violin plot.

jitter.alpha

Transperency of jitter plot.

jitter.size

Point size in jitter plot.

...

(The same parameters as above).

Details

Plots are drawn in this order: violin plot, jitter plot, boxplot.

Value

A ggplot object. More details in package ggplot2.

Note

If more information on matrix decomposition/factorisation is needed it can be found here or here).

Author(s)

Vilmantas Gegzna

See Also

Other spHelper plots: check_palette(), layer_spRangeMean(), plot_colors(), plot_hyPalette(), plot_spCompare(), plot_spDiff(), plot_spDistribution(), qplot_confusion(), qplot_crosstab(), qplot_infoDim(), qplot_kSp(), qplot_prediction(), qplot_spRangeCenter(), qplot_spRangeMedian(), qplot_spStat(), qplot_spc(), rmExpr(), rm_stripes(), stat_chull()

Other component analysis / factorisation related functions in spHelper: getScores(), infoDim(), plot_spDiff(), qplot_infoDim(), qplot_kSp(), qplot_spc(), reconstructSp(), sortLoadings(), unipeak(), whichOutlier()

Examples


data(Scores2)
qplot_kAmp(Scores2)
qplot_scores(Scores2)

data(Scores3)
qplot_kAmp(Scores3, by = "class")

sp3 <- hyAdd_color(Scores3, "class")
qplot_kAmp(sp3, by = "class")

p <- qplot_scores(Scores2, add.jitter = TRUE)
p

p + theme_bw()


GegznaV/spHelper documentation built on April 16, 2023, 1:42 p.m.