hyperSpec object or a matrixhy2mat.Rdhy2mat
hy2mat(sp)Spectroscopic data
(either a hyperSpec object or a matrix).
Either a matrix or an error, if it's impossible to extract a matrix.
Other spHelper functions for spectroscopy and hyperSpec:
IQR_outliers(),
binning(),
file,
gapDer(),
hyAdd_Label_wl(),
hyAdd_Labels_PAP_PD_2014(),
hyAdd_Labels_TD2009(),
hyAdd(),
hyDrop_NA(),
hyGet_palette(),
hyRm_palette(),
mad_outliers(),
mean_Nsd(),
median_Nmad(),
plot_hyPalette(),
prepare_PAP_RK_2014__MATLAB_failui(),
read.OOIBase32(),
read.OceanView.header(),
read.OceanView(),
read.sp.csv2(),
read3csv2hy(),
replace_spc(),
sd_outliers(),
spStat(),
sp_class_perform()
data(flu, package = "hyperSpec")
flu
#> hyperSpec object
#> 6 spectra
#> 3 data columns
#> 181 data points / spectrum
a <- hy2mat(flu)
b <- hy2mat(flu$spc)
#> Error in switch(class(sp), hyperSpec = sp$spc, matrix = sp, stop("The class of the input must be either \"hyperSpec\" or \"matrix\"")): EXPR must be a length 1 vector
identical(a,b)
#> Error in identical(a, b): object 'b' not found
## [1] TRUE
hy2mat(matrix(NA,5,10))
#> Error in switch(class(sp), hyperSpec = sp$spc, matrix = sp, stop("The class of the input must be either \"hyperSpec\" or \"matrix\"")): EXPR must be a length 1 vector