Added test for handleData
This commit is contained in:
parent
aec2f40c2c
commit
3d43ed856f
1 changed files with 31 additions and 0 deletions
|
|
@ -1,3 +1,34 @@
|
||||||
|
context("Auxiliary functions to greedyMix")
|
||||||
|
|
||||||
|
baps_diploid <- read.delim(
|
||||||
|
"inst/ext/ExamplesDataFormatting/Example data in BAPS format for clustering of diploid individuals.txt",
|
||||||
|
sep = " ",
|
||||||
|
header = FALSE
|
||||||
|
)
|
||||||
|
|
||||||
|
handleData(baps_diploid)$newData
|
||||||
|
|
||||||
|
test_that("handleData works as expected", {
|
||||||
|
data_obs <- handleData(baps_diploid)$newData
|
||||||
|
data_exp <- matrix(
|
||||||
|
c(
|
||||||
|
-9, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1,
|
||||||
|
-9, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1,
|
||||||
|
3, 2, 2, 3, 2, -9, 3, 1, 2, 1, 2,
|
||||||
|
2, 1, 2, 1, 2, -9, 1, 1, 1, 1, 2,
|
||||||
|
3, 1, 1, 1, 2, 1, 1, 2, -9, 1, 3,
|
||||||
|
3, 1, 2, 1, 1, 1, 2, 1, -9, 2, 3,
|
||||||
|
1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 4,
|
||||||
|
3, 2, 2, 3, 2, 2, 3, 1, 2, 1, 4,
|
||||||
|
2, 1, 2, 1, -9, 1, 1, 1, 1, 1, 5,
|
||||||
|
3, 1, 1, 1, -9, 1, 1, 2, 1, 1, 5
|
||||||
|
),
|
||||||
|
nrow = 10, byrow = TRUE
|
||||||
|
)
|
||||||
|
colnames(data_exp) <- colnames(data_obs)
|
||||||
|
expect_equal(data_obs, data_exp)
|
||||||
|
})
|
||||||
|
|
||||||
context("Opening files on greedyMix")
|
context("Opening files on greedyMix")
|
||||||
|
|
||||||
# TODO: needs #12 to be fixed before this can be done without user intervention
|
# TODO: needs #12 to be fixed before this can be done without user intervention
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue