tests/testthat/test-check_if_data_matrix.R

context("check_if_data_matrix")

test_that("check_if_data_matrix behaves as expected", {
    expect_true(check_if_data_matrix(matrix(0)))
    expect_true(check_if_data_matrix(data.frame()))
    expect_false(check_if_data_matrix(list()))
    expect_false(check_if_data_matrix(numeric(10)))

    ### Check Matrix package
# 4-12-16: Why do we want Matrix objects to return FALSE here? Deprecated for now.
#     library("Matrix")
#     expect_false(check_if_data_matrix(Matrix::Diagonal(10, 1)))
#     expect_false(check_if_data_matrix(Matrix::Matrix(matrix(0))))

})

Try the sparsebnUtils package in your browser

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

sparsebnUtils documentation built on Jan. 27, 2021, 9:05 a.m.