tests/testthat/test_checks.R

test_that("isPeaksMatrix", {
    expect_false(isPeaksMatrix(1:2))
    expect_false(isPeaksMatrix(matrix(1:3, nrow = 1)))
    expect_false(isPeaksMatrix(matrix(1:2, ncol = 2)))
    expect_false(isPeaksMatrix(cbind(foo = 1, bar = 2)))
    expect_false(isPeaksMatrix(cbind(mz = 1, bar = 2)))
    expect_false(isPeaksMatrix(cbind(mz = "A", intensity = "B")))
    expect_false(isPeaksMatrix(cbind(mz = 2:1, intensity = 2:1)))
    expect_true(isPeaksMatrix(cbind(mz = 1:2, intensity = 1:2)))
})

Try the MsCoreUtils package in your browser

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

MsCoreUtils documentation built on Nov. 8, 2020, 10:59 p.m.