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")
})

Try the spectrolab package in your browser

Any scripts or data that you put into this service are public.

spectrolab documentation built on Feb. 16, 2023, 10:27 p.m.