Skip to content
Snippets Groups Projects
Commit 3cb8ce53 authored by CARDENAS GWENDAELLE's avatar CARDENAS GWENDAELLE
Browse files

Delete test-computestats.R

parent cbac3d7e
No related branches found
No related tags found
No related merge requests found
set.seed(12081238)
base_data <- matrix(rnorm(2000), nrow = 100, ncol = 200)
group1 <- replicate(20, sample(1:100, 50, replace = FALSE))
group2 <- replicate(20, sample(101:200, 50, replace = FALSE))
conditions <- factor(rep(c(1, 2), each = 20))
trees <- apply(cbind(group1, group2), 2, function(asample) {
samples <- base_data[, asample]
out <- hclust(dist(samples), method = "ward.D2")
return(out)
})
trees1 <- trees[1:20]
trees2 <- trees[21:40]
test_that("'compute_stats' works for simple cases", {
res <- compute_stats(trees1, trees2)
expect_named(res, c("conditions", "cophenetics", "truncated_cophenetics",
"truncated_indices", "numerator", "variances"))
expect_equal(length(res$numerator), length(res$truncated_indices))
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment