Skip to contents

Convert hsi_cube to Tibble

Usage

as_tibble.hsi_cube(x, ..., long = TRUE, .name_repair = "unique")

Arguments

x

An hsi_cube object.

...

Additional arguments (ignored).

long

Logical. If TRUE (default), returns long format. See as.data.frame.hsi_cube() for details.

.name_repair

Name repair strategy (passed to tibble::as_tibble()).

Value

A tibble::tibble.

Examples

cube <- hs_example_cube()
tb <- as_tibble.hsi_cube(cube[1:3, 1:3, 1:3])
head(tb)
#> # A tibble: 6 × 4
#>       x     y wavelength  value
#>   <int> <int>      <dbl>  <dbl>
#> 1     1     1        430 0.0637
#> 2     1     1        438 0.0983
#> 3     1     1        446 0.164 
#> 4     1     2        430 0.0444
#> 5     1     2        438 0.0864
#> 6     1     2        446 0.172