tests/testthat/test_transpose.R

library("testthat")
library("spectrolab")

context("Spectra transpose")

spec = as_spectra(spec_matrix_example, name_idx = 1)

test_that("transposing spec throws", {
    expect_error( t(spec) )
})

test_that("transposing spec matrix", {
    expect_is(t(as.matrix(spec)), "matrix")
})

test_that("transposing spec data frame", {
    expect_is(t(as.data.frame(spec)), "matrix")
})
annakat/spectrolab documentation built on Oct. 14, 2023, 1:16 a.m.