tests/testthat/test_foldLibrary.R

library(testthat)
library(data.table)
library(caret)

test_that("Test foldLibrary", {

    featureLib <- readRDS("/home/jchitpin/Downloads/Masters/Projects/MATRIX/RPackages/testData/testthat_Validation Sphingo GT Jan 20 2017 only 192 samples Jan 27 2017.rds")
    mmi <- readRDS("/home/jchitpin/Downloads/Masters/Projects/MATRIX/RPackages/testData/testthat_mmi_Validation Sphingo GT Jan 20 2017 only 192 samples Jan 27 2017.rds")

    folds <- foldLibrary(DT_featureLibrary = featureLib,
                         cvFolds = 10, seed = 1)

    trueData <- readRDS(file = "/home/jchitpin/Downloads/Masters/Projects/MATRIX/RPackages/testData/testthat_folds_Validation Sphingo GT Jan 20 2017 only 192 samples Jan 27 2017.rds")
    expect_equal(folds, trueData)
})
jchitpin/blistR documentation built on July 8, 2019, 6:29 p.m.