Running ‘test.R’ [10s/14s]
Running the tests in ‘tests/test.R’ failed.
Complete output:
  > library(testthat)
  > test_check('gemtc', filter="unit")
  Loading required package: gemtc
  Loading required package: coda
  ── 1. Failure: two pairs return a two-row matrix (@test-unit-allpairs.R#20)  ───
  `x` not equal to `expected`.
  4/4 mismatches (average diff: NaN)
  [1] NA - 1.000 == NA
  [2] NA - 1.500 == NA
  [3] NA - 0.177 == NA
  [4] NA - 0.280 == NA
  
  ── 2. Failure: calculating pairs for relative effect data transforms the mvnorm 
  `x` not equal to `expected`.
  4/4 mismatches (average diff: 0.923)
  [1] 0 -  0.900 == -0.900
  [2] 0 - -1.400 ==  1.400
  [3] 0 -  0.690 == -0.690
  [4] 0 -  0.703 == -0.703
  
  ── 3. Failure: calculating pairs for relative effect data handles 1-pair case (@
  `x` not equal to `expected`.
  4/4 mismatches (average diff: 0.923)
  [1] 0 -  0.900 == -0.900
  [2] 0 - -1.400 ==  1.400
  [3] 0 -  0.690 == -0.690
  [4] 0 -  0.703 == -0.703
  
  ── 4. Failure: calculating pairs for relative effect data handles missing treatm
  `x` not equal to `expected`.
  2/2 mismatches (average diff: 1.05)
  [1] 0 - -1.400 ==  1.400
  [2] 0 -  0.703 == -0.703
  
  ── 5. Failure: guess.scale handles relative effect data (@test-unit-allpairs.R#7
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 0 - 2.3 == -2.3
  
  ── 6. Failure: guess.scale not confused by unrealized study levels (@test-unit-a
  `x` not equal to `expected`.
  1/1 mismatches
  [1] NA - 1.08 == NA
  
  ── 7. Failure: guess.scale not confused by unrealized study levels (@test-unit-a
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 0 - 1 == -1
  
  ── 8. Error: comparison in triangle gives TRUE (@test-unit-has.indirect.evidence
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. testthat::expect_that(...)
    6. gemtc:::has.indirect.evidence(network, "A", "B")
    7. gemtc:::mtc.network.graph(n)
    8. gemtc:::comp(network)
   10. base::`[<-.factor`(...)
  
  ── 9. Error: comparison in three-arm trial gives FALSE (@test-unit-has.indirect.
  Invalid vertex names
  Backtrace:
    1. testthat::expect_that(...)
    6. gemtc:::has.indirect.evidence(network, "A", "B")
    7. gemtc:::mtc.network.graph(n)
    8. gemtc:::graph.create(treatments, comparisons, arrow.mode = 0)
    9. igraph:::`+.igraph`(g, edges.create(e, ...))
   12. igraph:::as.igraph.vs(e1, toadd)
  
  ── 10. Error: four-arm trials are handled correctly (@test-unit-has.indirect.evi
  Invalid vertex names
  Backtrace:
    1. testthat::expect_that(...)
    6. gemtc:::has.indirect.evidence(network, "A", "B")
    7. gemtc:::mtc.network.graph(n)
    8. gemtc:::graph.create(treatments, comparisons, arrow.mode = 0)
    9. igraph:::`+.igraph`(g, edges.create(e, ...))
   12. igraph:::as.igraph.vs(e1, toadd)
  
  ── 11. Error: data.re is incorporated (@test-unit-has.indirect.evidence.R#101)  
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. testthat::expect_that(...)
    6. gemtc:::has.indirect.evidence(network, "A", "B")
    7. gemtc:::mtc.network.graph(n)
    8. gemtc:::comp(network)
   10. base::`[<-.factor`(...)
  
  ── 12. Error: Vertices agree between mtc.comparisons and the model tree (@test-u
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc::mtc.model(network)
    2. gemtc:::mtc.model.call("mtc.model", model, ...)
    4. gemtc:::mtc.model.consistency(...)
   17. gemtc:::mtc.network.graph(model[["network"]])
   18. gemtc:::comp(network)
   20. base::`[<-.factor`(...)
  
  ── 13. Error: mtc.comparisons.baseline identical to mtc.comparisons for two-arm 
  NAs are not allowed in subscripted assignments
  Backtrace:
   1. testthat::expect_that(mtc.comparisons.baseline(network), equals(mtc.comparisons(network)))
   6. gemtc:::mtc.comparisons(network)
   8. base::`[<-.factor`(...)
  
  ── 14. Error: Vertices agree between mtc.network.graph and ume model$graph (@tes
  NAs are not allowed in subscripted assignments
  Backtrace:
   1. gemtc:::mtc.network.graph(network)
   2. gemtc:::comp(network)
   4. base::`[<-.factor`(...)
  
  ── 15. Error: RE data will not introduce duplicate basic parameters (@test-unit-
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 16. Error: std.dev + sampleSize is rewritten to std.err (@test-unit-mtc.model
  Invalid vertex names
  Backtrace:
    1. gemtc::mtc.model(network, likelihood = "normal", link = "identity")
    2. gemtc:::mtc.model.call("mtc.model", model, ...)
    4. gemtc:::mtc.model.consistency(...)
   17. gemtc:::mtc.network.graph(model[["network"]])
   18. gemtc:::graph.create(treatments, comparisons, arrow.mode = 0)
   19. igraph:::`+.igraph`(g, edges.create(e, ...))
   22. igraph:::as.igraph.vs(e1, toadd)
  
  ── 17. Error: data.ab with std.err does not throw error (@test-unit-mtc.model_co
  Invalid vertex names
  Backtrace:
    1. gemtc::mtc.model(network, likelihood = "normal", link = "identity")
    2. gemtc:::mtc.model.call("mtc.model", model, ...)
    4. gemtc:::mtc.model.consistency(...)
   17. gemtc:::mtc.network.graph(model[["network"]])
   18. gemtc:::graph.create(treatments, comparisons, arrow.mode = 0)
   19. igraph:::`+.igraph`(g, edges.create(e, ...))
   22. igraph:::as.igraph.vs(e1, toadd)
  
  ── 18. Error: mtc.model.data includes correct fields for data.ab, normal.identit
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 19. Error: mtc.model.data includes correct fields for data.ab, binom.logit + 
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 20. Error: mtc.model.data omits studies with alpha=0 (powerAdjust) (@test-uni
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re, studies = studies)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 21. Error: mtc.model.data has correct values (1) (@test-unit-mtc.model_data.R
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 22. Error: mtc.model.data has correct values (2) (@test-unit-mtc.model_data.R
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 23. Error: not specifying likelihood / link generates warnings (@test-unit-mt
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. testthat::expect_warning(...)
    6. gemtc::mtc.model(network, likelihood = "normal")
    7. gemtc:::mtc.model.call("mtc.model", model, ...)
    9. gemtc:::mtc.model.consistency(...)
   22. gemtc:::mtc.network.graph(model[["network"]])
   23. gemtc:::comp(network)
   25. base::`[<-.factor`(...)
  
  ── 24. Error: mtc.init.mle.regression just returns 0 +/- om.scale (@test-unit-mt
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc:::minimum.diameter.spanning.tree(mtc.network.graph(network))
    8. gemtc:::mtc.network.graph(network)
    9. gemtc:::comp(network)
   11. base::`[<-.factor`(...)
  
  ── 25. Error: mtc.linearModel.matrix works correctly (@test-unit-mtc.model_inits
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 26. Error: mtc.linearModel.matrix works correctly for regression (@test-unit-
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 27. Error: likelihood.arm.list returns the correct arms (@test-unit-mtc.model
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 28. Error: mtc.model.inits has correct shape (@test-unit-mtc.model_inits.R#24
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 29. Error: mtc.model.inits - regression parameters have the correct shape (@t
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc:::minimum.diameter.spanning.tree(mtc.network.graph(network))
    8. gemtc:::mtc.network.graph(network)
    9. gemtc:::comp(network)
   11. base::`[<-.factor`(...)
  
  ── 30. Error: mtc.model.inits has correct heterogeneity parameter (@test-unit-mt
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc:::minimum.diameter.spanning.tree(mtc.network.graph(network))
    8. gemtc:::mtc.network.graph(network)
    9. gemtc:::comp(network)
   11. base::`[<-.factor`(...)
  
  ── 31. Error: mtc.init correctly restrains the baseline probability (@test-unit-
  Invalid vertex names
  Backtrace:
    1. gemtc:::minimum.diameter.spanning.tree(mtc.network.graph(network))
    8. gemtc:::mtc.network.graph(network)
    9. gemtc:::graph.create(treatments, comparisons, arrow.mode = 0)
   10. igraph:::`+.igraph`(g, edges.create(e, ...))
   13. igraph:::as.igraph.vs(e1, toadd)
  
  ── 32. Error: treatments for data.ab and data.re are merged (@test-unit-mtc.netw
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 33. Error: merged list of arms is correct (@test-unit-mtc.network_data.re.R#8
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 34. Error: mtc.nr.comparisons with a single study (@test-unit-mtc.nr.comparis
  subscript out of bounds
  Backtrace:
   1. gemtc:::mtc.nr.comparisons(network)
   2. plyr::aaply(...)
   3. plyr::laply(...)
   4. plyr::llply(...)
   7. gemtc:::.fun(piece, ...)
   8. base::rowSums(m[, co, drop = FALSE])
   9. base::is.data.frame(x)
  
  ── 35. Error: mtc.nr.comparisons with 2 studies (@test-unit-mtc.nr.comparisons.R
  subscript out of bounds
  Backtrace:
   1. gemtc:::mtc.nr.comparisons(network)
   2. plyr::aaply(...)
   3. plyr::laply(...)
   4. plyr::llply(...)
   7. gemtc:::.fun(piece, ...)
   8. base::rowSums(m[, co, drop = FALSE])
   9. base::is.data.frame(x)
  
  ── 36. Error: non-lexicographical treatment order works correctly (@test-unit-no
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc::mtc.model(network, type = "nodesplit", t1 = 10, t2 = 11)
    2. gemtc:::mtc.model.call("mtc.model", model, ...)
    4. gemtc:::mtc.model.nodesplit(...)
    6. gemtc:::has.indirect.evidence(network, t1, t2)
    7. gemtc:::mtc.network.graph(n)
    8. gemtc:::comp(network)
   10. base::`[<-.factor`(...)
  
  ── 37. Error: study names do not mess up nodesplit with RE data (@test-unit-node
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. testthat::expect_that(...)
    6. gemtc::mtc.nodesplit.comparisons(network)
    8. gemtc:::mtc.comparisons(network)
   10. base::`[<-.factor`(...)
  
  ── 38. Error: mixing AB and RE data will not duplicate comparisons (@test-unit-n
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, data.re = data.re)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  ── 39. Error: tree.relative.effect handles a more complex tree (@test-unit-relat
  NAs are not allowed in subscripted assignments
  Backtrace:
    1. gemtc:::minimum.diameter.spanning.tree(mtc.network.graph(network))
    8. gemtc:::mtc.network.graph(network)
    9. gemtc:::comp(network)
   11. base::`[<-.factor`(...)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 256 | SKIPPED: 2 | WARNINGS: 1 | FAILED: 39 ]
  1. Failure: two pairs return a two-row matrix (@test-unit-allpairs.R#20) 
  2. Failure: calculating pairs for relative effect data transforms the mvnorm (@test-unit-allpairs.R#33) 
  3. Failure: calculating pairs for relative effect data handles 1-pair case (@test-unit-allpairs.R#46) 
  4. Failure: calculating pairs for relative effect data handles missing treatments (@test-unit-allpairs.R#60) 
  5. Failure: guess.scale handles relative effect data (@test-unit-allpairs.R#76) 
  6. Failure: guess.scale not confused by unrealized study levels (@test-unit-allpairs.R#82) 
  7. Failure: guess.scale not confused by unrealized study levels (@test-unit-allpairs.R#86) 
  8. Error: comparison in triangle gives TRUE (@test-unit-has.indirect.evidence.R#20) 
  9. Error: comparison in three-arm trial gives FALSE (@test-unit-has.indirect.evidence.R#49) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted