• Package and class “hyperSpec”
  • hyperSpec-package

    Package "hyperSpec": interface for hyperspectral datasets

    hyperSpec-class

    Class hyperSpec

  • Utility functions
  • .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

    is_hyperSpec() assert_hyperSpec()

    Check and validate hyperSpec objects

    hy_get_options() hy_get_option() hy_set_options()

    Options for package hyperSpec

  • 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

  • Create and convert hyperSpec objects
  • Create or convert from/into hyperSpec

    new_hyperSpec() initialize(<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()

    Convert hyperSpec object into a data frame or matrix

  • Import and export hyperSpec objects
  • Read/Write from/to 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()

    (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

  • Plotting
  • Plots

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

    Plot hyperSpec objects

    calculate_offsets()

    Y offsets for stacked plots

    plot_map() levelplot(<formula>,<hyperSpec>) levelplot(<hyperSpec>,<missing>) map.identify() plot_voronoi()

    Plot a map and identify/select spectra in the map

    plot_c()

    Calibration plots, timeseries plots, and depth-profiles

    plot_matrix()

    Plot spectra matrix

    plot_spc()

    Plotting spectra

    Color palettes

    palette_colorblind colors,palette_colorblind

    Color suggestions for hyperSpec users

    palette_matlab() palette_matlab_dark() palette_alois()

    Matlab-like color palettes

    Plotting tools

    identify_spc() locate_spc_point_max() locate_spc_point_clicked() locate_spc_point_min() locate_spc_point_parabola_max() format_label_ispc_wl() format_label_wl_only()

    Identifying spectra and spectral data points

    plot_map() levelplot(<formula>,<hyperSpec>) levelplot(<hyperSpec>,<missing>) map.identify() plot_voronoi()

    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_groups_in_dendrogram()

    Mark groups in stats::hclust() dendrograms

    mark_peak()

    Mark peak

    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

  • 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>)

    Bind 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

    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

    normalize_01()

    Normalize numbers to interval [0, 1]

    raster_make() raster_fit()

    Find an evenly spaced grid for x

    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>) cov_pooled()

    Covariance matrices for hyperSpec objects

    dist_pearson()

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

    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

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

    Sample or permute rows of hyperSpec, data.frame, or matrix

    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<-`()

    Get and set the wavelength axis

    wl2i() i2wl()

    Conversion between Wavelength and spectra matrix column

    wl_convert_units()

    Convert between different wavelength units

    wl_create_label_from_units()

    Create label from units for wavelength axis

    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

  • Other functions
  • Functions not mentioned above.

    .wl_fix_unit_name()

    Bring argument to a conventional name

  • 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()

    (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

    chk.hy()

    (DEPRECATED) Validate hyperSpec objects

    .fix_spc_colnames()

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

    guess.wavelength()

    (DEPRECATED) Guess wavelengths from character vector

    isample()

    (DEPRECATED) Return vector of row indices

    mark.dendrogram()

    (DEPRECATED) Identifying spectra and spectral data points

    markpeak()

    (DEPRECATED) Find an evenly spaced grid for x

    normalize01()

    (DEPRECATED) Normalize numbers to interval [0, 1]

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

    (DEPRECATED) Options for package hyperSpec

    orderwl()

    (DEPRECATED) Sorting the wavelengths of a hyperSpec object

    pearson.dist()

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

    plotc()

    (DEPRECATED) Plotting spectra

    plotmap()

    (DEPRECATED) Plotting spectra

    plotmat()

    (DEPRECATED) Plotting spectra

    plotspc()

    (DEPRECATED) Plotting spectra

    plotvoronoi()

    (DEPRECATED) Plotting spectra

    pooled.cov()

    (DEPRECATED) Pooled covariance matrix

    makeraster() fitraster()

    (DEPRECATED) Find an evenly spaced grid for x

    spc.rubberband()

    (DEPRECATED) Rubberband baseline correction

    spc.NA.approx()

    (DEPRECATED) Impute missing data points

    spc.bin()

    (DEPRECATED) Wavelength binning

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

    (DEPRECATED) Identifying spectra and spectral data points

    spc.loess()

    (DEPRECATED) LOESS smoothing interpolation for spectra

    spc.smooth.spline()

    (DEPRECATED) Spectral smoothing by splines

    stacked.offsets()

    (DEPRECATED) Calculate y-axis offsets

    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) Deprecated and defunct functions