tests/testthat/test-getSilhouette.R

context("getSilhouette")

demo <- suppressWarnings(get_demo_cluster())

test_that("getSilhouette failed on invalid input", {
    expect_error(getSilhouette("a"), "no applicable method for")
    expect_error(getSilhouette(1),"no applicable method for")
    expect_error(getSilhouette(c(1,2)), "no applicable method for")
    expect_error(getSilhouette(NA), "no applicable method for")
    expect_error(getSilhouette(NULL), "no applicable method for")
})

test_that("getSilhouette works", {
    expect_is(getSilhouette(demo$pca), "numeric")
    expect_is(getSilhouette(demo$spca), "numeric")
    
    expect_is(getSilhouette(demo$pls), "numeric")
    expect_is(getSilhouette(demo$spls), "numeric")
    
    expect_is(getSilhouette(demo$block.pls), "numeric")
    expect_is(getSilhouette(demo$block.spls), "numeric")
})

Try the timeOmics package in your browser

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

timeOmics documentation built on Nov. 8, 2020, 10:58 p.m.