These hyperSpec functions are deprecated and not maintained any more. You should not use these. Currently they are present due to back-compatibility reasons and will be removed in the next release of the package. Please, use the suggested alternative functions instead.

_____________

Replace NAs in the spectra matrix by interpolation. With less than 4 points available linear interpolation of the 2 neighbour points is used. For larger numbers of neighbour points, smoothing interpolation is performed by stats::smooth.spline().

spc.NA.approx(
spc,
neighbours = 1,
w = rep(1, 2 * neighbours),
df = 1 + .Machine\$double.eps,
spar = NULL,
debuglevel = hy_get_option("debuglevel")
)

## Arguments

spc

hyperSpec object with spectra matrix containing NAs

neighbours

how many neighbour data points should be used to fit the line

w, df, spar

see stats::smooth.spline()

debuglevel

see options()

hyperSpec object

Claudia Beleites

## Examples

fluNA <- hyperSpec:::fluNA
spc.NA.approx(fluNA[, , min ~ 410], debuglevel = 1)
#> Warning: Function 'spc.NA.approx' is deprecated.
#> Warning: Spectra containing only NAs found. They will not be approximated.

#> hyperSpec object
#>    6 spectra
#>    3 data columns
#>    11 data points / spectrum
spc.NA.approx(fluNA[1, , min ~ 410], debuglevel = 2)
#> Warning: Function 'spc.NA.approx' is deprecated.

#> hyperSpec object
#>    1 spectra
#>    3 data columns
#>    11 data points / spectrum
spc.NA.approx(fluNA[4, , min ~ 410], neighbours = 3, df = 4, debuglevel = 2)
#> Warning: Function 'spc.NA.approx' is deprecated.