tests/testthat/test_pca.R

context('PCA')

pca <- prcomp(USArrests)
test_that('getPcaVars', {
    expect_equal(getPcaVars(pca)[1], 96.6)
    expect_equal(getPcaVars(pca, digits = 5)[2], 2.7817)
})
LieberInstitute/jaffelab documentation built on Nov. 16, 2018, 4:20 p.m.