1. Package and class "hyperSpec"

hyperSpec-package

Package "hyperSpec": interface for hyperspectral datasets

hyperSpec-class

Class hyperSpec

2. Utility functions

chk.hy()

Validation of hyperSpec objects

.DollarNames(<hyperSpec>)

Command line completion for $

hy_attach()

Load and attach hyperSpec and all installed R hyperSpec family (hySpc.*) packages

hy_browse_homepage()

Browse homepage of R hyperSpec

hy_list_available_hySpc_packages()

List available R hyperSpec family packages

hy_list_installed_hySpc_packages()

List installed R hyperSpec family packages

hy.getOptions() hy.getOption() hy.setOptions()

Options for package hyperSpec

3. Datasets

Datasets to try functionality of hyperSpec functions.

barbiturates

Barbiturates spectra from .spc example files

generate_faux_cell() faux_cell

Faux cell dataset for testing & demonstration

flu

Quinine fluorescence spectra

laser

Laser emission dataset

paracetamol

Paracetamol spectrum

4. Create and convert `hyperSpec` objects

Create or convert from/into `hyperSpec`

initialize(<hyperSpec>) new_hyperSpec()

Create a hyperSpec object

as.hyperSpec()

as.hyperSpec: convenience conversion functions

as.data.frame(<hyperSpec>) as.matrix(<hyperSpec>) as.wide.df() as.long.df() as.t.df()

Conversion of a hyperSpec object into a data frame or matrix

5. Import and export `hyperSpec` objects

Read/Write from/to files

read.mat.Cytospec()

(DEPRECATED) Import for Cytospec mat files

read_txt_long() read_txt_wide()

Import and Export of hyperSpec objects

write_txt_long() write_txt_wide()

Export hyperSpec objects to ASCII (text) files

! Moved to package hySpc.read.ENVI

You should use analogous functions from package hySpc.read.ENVI as these functions will be removed soon.

read.ENVI() read.ENVI.HySpex() read.ENVI.Nicolet()

(DEPRECATED) Import of ENVI data

! Moved to package hySpc.read.jdx

You should use analogous functions from package hySpc.read.jdx as these functions will be removed soon.

read.jdx()

(DEPRECATED) JCAMP-DX import for Shimadzu library spectra

! Moved to package hySpc.read.mat

You should use analogous functions from package hySpc.read.mat as these functions will be removed soon.

read.mat.Cytospec()

(DEPRECATED) Import for Cytospec mat files

read.mat.Witec()

(DEPRECATED) Read .mat file into hyperSpec object

! Moved to package hySpc.read.spc

You should use analogous functions from package hySpc.read.spc as these functions will be removed soon.

read.spc.Kaiser() read.spc.KaiserMap() read.spc.KaiserLowHigh()

(DEPRECATED) Import functions for Kaiser Optical Systems .spc files

read.spc()

(DEPRECATED) Import for Thermo Galactic's spc file format

! Moved to package hySpc.read.spe

You should use analogous functions from package hySpc.read.spe as these functions will be removed soon.

read.spe() spe.showcalpoints()

(DEPRECATED) Import WinSpec SPE file

.read.spe.xml()

(DEPRECATED) Read XML footer from SPE file format version 3.0

! Moved to package hySpc.read.txt

You should use analogous functions from package hySpc.read.txt as these functions will be removed soon.

count_lines() count_lines()

(DEPRECATED) Count lines (of an ASCII File)

read.ini()

(DEPRECATED) Read INI files

read.asc.Andor()

(DEPRECATED) Import Raman spectra/maps from Andor cameras/solis ASCII files

read.asc.PerkinElmer()

(DEPRECATED) File import filter PerkinElmer ASCII spectra

read.txt.Horiba() read.txt.Horiba.xy() read.txt.Horiba.t()

(DEPRECATED) Import Horiba Labspec exported ASCII files

read.txt.Renishaw() read.zip.Renishaw()

(DEPRECATED) Import Raman measurements from Renishaw ASCII-files

read.txt.Shimadzu()

(DEPRECATED) Read Shimadzu GCxGC-qMS - spectra files (.txt)

read.txt.Witec() read.dat.Witec() read.txt.Witec.Graph()

(DEPRECATED) Import Raman spectra from Witec files

read.txt.long() read.txt.wide()

(DEPRECATED) Import hyperSpec objects from ASCII (text) files

wc()

(DEPRECATED) Line/word/character count of ASCII files

6. Plotting

Plots

plot(<hyperSpec>,<missing>) plot(<hyperSpec>,<character>)

Plotting hyperSpec objects

plotmap() levelplot(<formula>,<hyperSpec>) levelplot(<hyperSpec>,<missing>) map.identify() plotvoronoi()

Plot a map and identify/select spectra in the map

plotc()

Calibration plots, timeseries plots, and depth-profiles

plotmat()

Plot spectra matrix

plotspc() stacked.offsets()

Plotting spectra

Color palettes

palette_colorblind

Color suggestions for hyperSpec users

palette_matlab() palette_matlab_dark() palette_alois()

Matlab-like color palettes

Plotting tools

plotmap() levelplot(<formula>,<hyperSpec>) levelplot(<hyperSpec>,<missing>) map.identify() plotvoronoi()

Plot a map and identify/select spectra in the map

map.sel.poly() sel.poly()

Interactively select a polygon (grid graphics) and highlight points

mark.dendrogram()

Mark groups in stats::hclust() dendrograms

markpeak()

Mark peak

spc.identify() spc.point.max() spc.point.default() spc.point.min() spc.point.sqr() spc.label.default() spc.label.wlonly()

Identifying spectra and spectral data points

trellis.factor.key()

Color coding legend for factors

! Moved to package hySpc.ggplot2

You should use analogous functions from package hySpc.ggplot2 as these functions will be removed soon.

qplotspc() qplotmap() qplotc() qplotmixmap() legendright() qmixtile() normalize.colrange() normalize.range() normalize.null() normalize.minmax() qmixlegend() colmix.rgb()

(DEPRECATED) Spectra plotting with ggplot2 was moved to hySpc.ggplot2

7. Data manipulation

Summary and data preview

ncol(<hyperSpec>) nrow(<hyperSpec>) nwl() dim(<hyperSpec>) length(<hyperSpec>)

Number of rows (spectra), columns, and data points per spectrum of a hyperSpec object

show(<hyperSpec>) print(<hyperSpec>) summary(<hyperSpec>) as.character(<hyperSpec>)

Show brief summary of hyperSpec object

Manipulation

Arith(<hyperSpec>,<hyperSpec>) Arith(<hyperSpec>,<missing>) Arith(<hyperSpec>,<numeric>) Arith(<hyperSpec>,<matrix>) Arith(<numeric>,<hyperSpec>) Arith(<matrix>,<hyperSpec>) `%*%`(<hyperSpec>,<hyperSpec>) `%*%`(<hyperSpec>,<matrix>) `%*%`(<matrix>,<hyperSpec>)

Arithmetical operators: +, -, *, /, ^, %%, %/%, %*% for hyperSpec objects

Compare(<hyperSpec>,<hyperSpec>) Compare(<hyperSpec>,<numeric>) Compare(<hyperSpec>,<matrix>) Compare(<numeric>,<hyperSpec>) Compare(<matrix>,<hyperSpec>) all.equal(<hyperSpec>,<hyperSpec>)

Comparison of hyperSpec objects

aggregate(<hyperSpec>)

Aggregate hyperSpec objects

apply(<hyperSpec>)

Compute summary statistics for the spectra of a hyperSpec object

bind() cbind(<hyperSpec>) rbind(<hyperSpec>) cbind2(<hyperSpec>,<hyperSpec>) cbind2(<hyperSpec>,<missing>) rbind2(<hyperSpec>,<hyperSpec>) rbind2(<hyperSpec>,<missing>)

Binding hyperSpec objects

collapse()

Collapse/bind several hyperSpec objects into one object

decomposition()

Convert principal component decomposition or the like into a hyperSpec object

dimnames(<hyperSpec>) rownames(<hyperSpec>) `rownames<-`(<hyperSpec>) colnames(<hyperSpec>) `colnames<-`(<hyperSpec>)

Dimnames for hyperSpec objects

.spc_fix_colnames()

Ensure that the spectra matrix has the wavelengths in column names

droplevels(<hyperSpec>)

Droplevels for hyperSpec objects

empty()

Empty hyperSpec object

`[`(<hyperSpec>) `[[`(<hyperSpec>) `$`(<hyperSpec>) `[<-`(<hyperSpec>) `[[<-`(<hyperSpec>) `$<-`(<hyperSpec>)

Extract and replace parts of hyperSpec objects

makeraster() fitraster()

Find an evenly spaced grid for x

Math2(<hyperSpec>) log(<hyperSpec>) Math(<hyperSpec>)

Mathematical functions for hyperSpec objects

mean_sd(<numeric>) mean_sd(<matrix>) mean_sd(<hyperSpec>) mean_pm_sd(<numeric>) mean_pm_sd(<matrix>) mean_pm_sd(<hyperSpec>) mean(<hyperSpec>) quantile(<hyperSpec>)

Mean and standard deviation

merge(<hyperSpec>,<hyperSpec>) merge(<hyperSpec>,<data.frame>) merge(<data.frame>,<hyperSpec>)

Merge hyperSpec objects

merge_data()

Merge additional extra data into an object

normalize01()

Normalize numbers to interval [0, 1]

rbind.fill(<matrix>) rbind(<fill>)

Bind matrices by row, and fill missing columns with NA.

scale(<hyperSpec>)

Center and scale hyperSpec object

seq(<hyperSpec>)

Sequence generation along spectra or wavelengths

spc_na_approx()

Impute missing data points

split(<hyperSpec>)

Split a hyperSpec object according to groups

subset(<hyperSpec>)

Subset hyperSpec object

sweep(<hyperSpec>)

Sweep summary statistic out of hyperSpec objects

Baseline manipulation

spc_fit_poly() spc_fit_poly_below()

Polynomial baseline fitting

spc_rubberband()

Rubberband baseline correction

Binning and smoothing

spc_bin()

Wavelength binning

spc_loess()

LOESS smoothing interpolation for spectra

spc_smooth_spline()

Spectral smoothing by splines

Data generation functions

generate_faux_cell() faux_cell

Faux cell dataset for testing & demonstration

generate_hy_spectra() generate_hy_profile() generate_hy_map()

Generate spectroscopic data

rmmvnorm()

Multivariate normal random numbers

vanderMonde()

Function evaluation on hyperSpec objects

Statistics, analysis, randomization

aggregate(<hyperSpec>)

Aggregate hyperSpec objects

apply(<hyperSpec>)

Compute summary statistics for the spectra of a hyperSpec object

colMeans(<hyperSpec>) colSums(<hyperSpec>) rowMeans(<hyperSpec>) rowSums(<hyperSpec>)

Functions colSums(), colMeans(), rowSums(), and rowMeans() for hyperSpec objects

cov(<hyperSpec>,<missing>) pooled.cov()

Covariance matrices for hyperSpec objects

mean_sd(<numeric>) mean_sd(<matrix>) mean_sd(<hyperSpec>) mean_pm_sd(<numeric>) mean_pm_sd(<matrix>) mean_pm_sd(<hyperSpec>) mean(<hyperSpec>) quantile(<hyperSpec>)

Mean and standard deviation

pearson.dist()

Distance based on Pearson's \(R^2\)

sample(<hyperSpec>) isample() sample(<data.frame>) sample(<matrix>)

Random samples and permutations

Summary(<hyperSpec>) is.na(<hyperSpec>) all_wl() any_wl()

Statistical summary and other functions for hyperSpec

sweep(<hyperSpec>)

Sweep summary statistic out of hyperSpec objects

Wavelength manipulation

extract_numbers()

Guess wavelengths from character vector

wl() `wl<-`()

Getting and setting the wavelength axis

wl2i() i2wl()

Conversion between Wavelength and Spectra Matrix Column.

wl_convert_units()

Convert between different wavelength units

wl_eval()

Evaluate function on wavelengths of hyperSpec object

wl_sort()

Sorting the wavelengths of a hyperSpec object

Label manipulation

labels(<hyperSpec>) `labels<-`()

Get and set labels of a hyperSpec object

8. Other functions

Functions not mentioned above.

skip_if_not_fileio_available()

Helper function for unit testing

9. Removed or deprecated functions

Functions moved to other packages

The following functions were moved to other r-hyperspec family packages. In most cases, the functions were also renamed. Please, use the analogues of these functions, which are in appropriate packages.

qplotspc() qplotmap() qplotc() qplotmixmap() legendright() qmixtile() normalize.colrange() normalize.range() normalize.null() normalize.minmax() qmixlegend() colmix.rgb()

(DEPRECATED) Spectra plotting with ggplot2 was moved to hySpc.ggplot2

read.ENVI() read.ENVI.HySpex() read.ENVI.Nicolet()

(DEPRECATED) Import of ENVI data

read.jdx()

(DEPRECATED) JCAMP-DX import for Shimadzu library spectra

read.mat.Cytospec()

(DEPRECATED) Import for Cytospec mat files

read.mat.Witec()

(DEPRECATED) Read .mat file into hyperSpec object

read.spc.Kaiser() read.spc.KaiserMap() read.spc.KaiserLowHigh()

(DEPRECATED) Import functions for Kaiser Optical Systems .spc files

read.spc()

(DEPRECATED) Import for Thermo Galactic's spc file format

read.spe() spe.showcalpoints()

(DEPRECATED) Import WinSpec SPE file

.read.spe.xml()

(DEPRECATED) Read XML footer from SPE file format version 3.0

count_lines() count_lines()

(DEPRECATED) Count lines (of an ASCII File)

read.ini()

(DEPRECATED) Read INI files

read.asc.Andor()

(DEPRECATED) Import Raman spectra/maps from Andor cameras/solis ASCII files

read.asc.PerkinElmer()

(DEPRECATED) File import filter PerkinElmer ASCII spectra

read.txt.Horiba() read.txt.Horiba.xy() read.txt.Horiba.t()

(DEPRECATED) Import Horiba Labspec exported ASCII files

read.txt.Renishaw() read.zip.Renishaw()

(DEPRECATED) Import Raman measurements from Renishaw ASCII-files

read.txt.Shimadzu()

(DEPRECATED) Read Shimadzu GCxGC-qMS - spectra files (.txt)

read.txt.Witec() read.dat.Witec() read.txt.Witec.Graph()

(DEPRECATED) Import Raman spectra from Witec files

read.txt.long() read.txt.wide()

(DEPRECATED) Import hyperSpec objects from ASCII (text) files

wc()

(DEPRECATED) Line/word/character count of ASCII files

Deprecated, renamed, or defunct functions

You should not use these functions any more.

spc.fit.poly() spc.fit.poly.below()

(DEPRECATED) Polynomial baseline fitting

.fix_spc_colnames()

(DEPRECATED) Ensure that the spectra matrix has the wavelengths in column names

guess.wavelength()

(DEPRECATED) Guess wavelengths from character vector

orderwl()

(DEPRECATED) Sorting the wavelengths of a hyperSpec object

spc.rubberband()

(DEPRECATED) Rubberband baseline correction

spc.NA.approx()

(DEPRECATED) Impute missing data points

spc.bin()

(DEPRECATED) Wavelength binning

spc.loess()

(DEPRECATED) LOESS smoothing interpolation for spectra

spc.smooth.spline()

(DEPRECATED) Spectral smoothing by splines

read.txt.long() read.txt.wide()

(DEPRECATED) Import hyperSpec objects from ASCII (text) files

wl.eval()

(DEPRECATED) Evaluate function on wavelengths of hyperSpec object

wlconv() nm2raman() nm2invcm() nm2ev() nm2freq() invcm2raman() invcm2nm() invcm2ev() invcm2freq() raman2invcm() raman2nm() raman2ev() raman2freq() ev2raman() ev2invcm() ev2nm() ev2freq() freq2nm() freq2invcm() freq2ev() freq2raman()

(DEPRECATED) Convert different wavelength units

write.txt.long() write.txt.wide()

(DEPRECATED) Export hyperSpec objects to ASCII (text) files

scan.asc.Andor() scan.txt.Renishaw() scan.zip.Renishaw() scan.txt.Witec() scan.dat.Witec() scan.txt.Witec.Graph() read.cytomat()

Deprecated and defunct functions