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.

_____________

Character vectors used for names (e.g. colnames for matrices or data.frames) are often treated by base::make.names() or similar functions that produce suitable names (e.g. by pre-pending "X" to numbers). Such names cannot be directly converted to numeric.

guess.wavlength() tries to extract numbers from X which may be surrounded by such "protecting" characters.

guess.wavelength(X)

Arguments

X

character with numbers hidden inside

Value

numeric

Examples

tmp <- data.frame(flu[[, , 400 ~ 410]])
(wl <- colnames(tmp))
#>  [1] "X405"   "X405.5" "X406"   "X406.5" "X407"   "X407.5" "X408"   "X408.5"
#>  [9] "X409"   "X409.5" "X410"  
guess.wavelength(wl)
#> Warning: Function 'guess.wavelength' is deprecated. 
#> Use function 'extract_numbers' instead.
#>  [1] 405.0 405.5 406.0 406.5 407.0 407.5 408.0 408.5 409.0 409.5 410.0