hyperSpec2spectra: Convert a hyperSpec object to a ChemoSpec object

Description Usage Arguments Value Author(s) Examples

View source: R/hyperSpec2spectra.R

Description

This function converts a hyperSpec object from the package of the same name, to a Spectra object as used in the ChemoSpec package.

Usage

1
2
3
4
5
6
7
hyperSpec2spectra(
  hyperSpec,
  desc = "no description provided",
  names = NULL,
  groups = NULL,
  colors = NULL
)

Arguments

hyperSpec

A hyperSpec object.

desc

Character. A description of the data set.

names

Character. A vector of sample names.

groups

Factor. A vector of factors giving the sample membership.

colors

Character. A vector of colors.

Value

A Spectra object.

Author(s)

Conor McManus

Examples

1
2
3
4
5
6
7
8
9
require("hyperSpec")
require("RColorBrewer")
quinine <- hyperSpec2spectra(hyperSpec = flu,
  desc = "Quinine fluorescence calibration data from hyperSpec",
  names = paste("flu", 1:6, sep = ""),
  groups = rep("calib", 6),
  colors = brewer.pal(6, "Set1"))
sumSpectra(quinine)
str(quinine)

Chathurga/HyperChemoBridge documentation built on Sept. 5, 2020, 9:28 a.m.