Learn R Programming

hyperSpec (version 0.98-20140523)

qplotspc: Spectra plotting with ggplot2

Description

Spectra plotting with ggplot2

Usage

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
spc.nmax
maximum number of spectra to plot
map.lineonly
if TRUE, mapping will be handed to geom_line instead of ggplot.

Value

Details

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

See Also

plotspc

ggplotgeom_line

Examples

Run this code
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 ~ .)

Run the code above in your browser using DataLab