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")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.