Convenience function to remove offset from spectroscopic data in a hyperSpec object.

sp_remove_offset(
  sp,
  in_range = min ~ max,
  offset = 0,
  method = "not_used_yet",
  at = NULL
)

Arguments

sp

hyperSpec object.

in_range, at

(numeric | formula)
either a single numeric value or a pair of values describing the range (e.g., 300~350) of wavelengths to be used for normalization. Default is range = min~max.

offset

(number)
value of desired offset.

Value

sp with y-axis offset removed in (sp@data$spc).

Examples


library(magrittr)

Spectra2 %>% plotspc()
#> Warning: Function 'plotspc' is deprecated. 
#> Use function 'plot_spc' instead.


Spectra2 %>% sp_remove_offset() %>% plotspc()
#> Warning: Function 'plotspc' is deprecated. 
#> Use function 'plot_spc' instead.


Spectra2 %>% sp_remove_offset(in_range = 300~400) %>% plotspc()
#> Warning: Function 'plotspc' is deprecated. 
#> Use function 'plot_spc' instead.