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 Aug. 15, 2018, 4:37 a.m.