The following functions for hyperSpec objects:

All these functions work on the spectra matrix.

# S4 method for hyperSpec
Summary(x, ..., na.rm = FALSE)

# S4 method for hyperSpec
is.na(x)

all_wl(expression, na.rm = FALSE)

any_wl(expression, na.rm = FALSE)

Arguments

x

hyperSpec object

...

further objects

na.rm

logical indicating whether missing values should be removed

expression

expression that evaluates to a logical matrix of the same size as the spectra matrix

Value

sum, prod, min, max, and range return a numeric, all, any, and is.na a logical.

Details

all_wl() and any_wl() are shortcut function to check whether any or all intensities fulfill the condition per spectrum. na.rm behavior is like base::all() and base::any().

See also

base::Summary() for the base summary functions.

base::all.equal() and base::isTRUE()

Examples

range(flu)
#> [1] 27.1500 677.4947
is.na(flu[, , 405 ~ 410])
#> 405 405.5 406 406.5 407 407.5 408 408.5 409 409.5 410 #> [1,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [2,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [3,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [4,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [5,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE #> [6,] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
all_wl(flu > 100)
#> [1] FALSE FALSE FALSE TRUE TRUE TRUE
any_wl(flu > 300)
#> [1] FALSE FALSE TRUE TRUE TRUE TRUE
!any_wl(is.na(flu))
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE