qplotspc: Spectra plotting with ggplot2

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/qplot.R

Description

Spectra plotting with ggplot2

Usage

1
2
qplotspc(x, wl.range, ..., mapping = aes_string(x = ".wavelength", y = "spc",
  group = ".rownames"), spc.nmax = 10, map.lineonly = FALSE)

Arguments

x

hyperSpec object

wl.range

wavelength ranges to plot

...

handed to geom_line

mapping

see geom_line

spc.nmax

maximum number of spectra to plot

map.lineonly

if TRUE, mapping will be handed to geom_line instead of ggplot.

Details

These functions are still experimental and may change substantially in future.

Value

a ggplot object

Author(s)

Claudia Beleites

See Also

plotspc

ggplotgeom_line

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
qplotspc (chondro)
  qplotspc (paracetamol, c (2800 ~ max, min ~ 1800)) + scale_x_reverse (breaks = seq (0, 3200, 400))

  qplotspc (aggregate (chondro, chondro$clusters, mean),
            mapping = aes (x = .wavelength, y = spc, colour = clusters)) +
    facet_grid (clusters ~ .)

  qplotspc (aggregate (chondro, chondro$clusters, mean_pm_sd),
            mapping = aes (x = .wavelength, y = spc, colour = clusters, group = .rownames)) +
    facet_grid (clusters ~ .)

Example output

Loading required package: lattice
Loading required package: grid
Loading required package: ggplot2
Package hyperSpec, version 0.98-20161118

To get started, try
   vignette ("introduction", package = "hyperSpec")
   package?hyperSpec 
   vignette (package = "hyperSpec")

If you use this package please cite it appropriately.
   citation("hyperSpec")
will give you the correct reference.

The project homepage is http://hyperspec.r-forge.r-project.org


Warning message:
In qplotspc(chondro) :
  Number of spectra exceeds spc.nmax. Only the first 10 are plotted.

hyperSpec documentation built on May 31, 2017, 3:47 a.m.