Running 'test.R' [12s]
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: single pair-wise comparison gives FALSE (@test-unit-has.indirect.ev
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 9. Error: comparison in triangle gives TRUE (@test-unit-has.indirect.evidence
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 10. Error: comparison in three-arm trial gives FALSE (@test-unit-has.indirect
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 11. Error: four-arm trials are handled correctly (@test-unit-has.indirect.evi
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 12. Error: data.re is incorporated (@test-unit-has.indirect.evidence.R#101)  
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. testthat::expect_that(...)
   6. gemtc:::has.indirect.evidence(network, "A", "B")
   7. gemtc::mtc.network(data)
   8. gemtc:::mtc.network.validate(network)
   9. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 13. 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`(...)
  
  -- 14. Error: mtc.comparisons.baseline identical to mtc.comparisons for two-arm 
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 15. Error: mtc.comparisons.baseline only includes baseline comparisons for mu
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 16. 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`(...)
  
  -- 17. 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"]]))
  
  -- 18. Error: the model generates correctly (@test-unit-mtc.model.use.R#12)  ---
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 19. Error: std.dev + sampleSize is rewritten to std.err (@test-unit-mtc.model
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 20. Error: data.ab missing sampleSize throws error (@test-unit-mtc.model_colu
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 21. Error: data.ab missing std.dev throws error (@test-unit-mtc.model_columns
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 22. Error: data.ab missing mean throws error (@test-unit-mtc.model_columns.R#
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 23. Error: data.ab with std.err does not throw error (@test-unit-mtc.model_co
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 24. Error: mtc.model.data runs on simple data (@test-unit-mtc.model_data.R#8)
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 25. Error: mtc.model.data complains about NAs in data.ab (@test-unit-mtc.mode
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 26. 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)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 27. Error: mtc.model.data includes correct fields for data.ab, binom.cloglog 
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 28. Error: mtc.model.data includes correct fields for data.ab, poisson.log (@
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 29. 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)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 30. 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"]]))
  
  -- 31. 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"]]))
  
  -- 32. 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"]]))
  
  -- 33. 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"]]))
  
  -- 34. 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"]]))
  
  -- 35. 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`(...)
  
  -- 36. Error: mtc.model refuses duplicated arms (@test-unit-mtc.model_duparm.R#4
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(...)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 37. Error: mtc.init.mle.regression just returns 0 +/- om.scale (@test-unit-mt
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 38. 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"]]))
  
  -- 39. 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"]]))
  
  -- 40. 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"]]))
  
  -- 41. 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"]]))
  
  -- 42. Error: mtc.model.inits - regression parameters have the correct shape (@t
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, studies = studies)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 43. Error: mtc.model.inits has correct heterogeneity parameter (@test-unit-mt
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 44. Error: mtc.init correctly restrains the baseline probability (@test-unit-
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(read.csv("../data/rr-pairwise.csv"))
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 45. 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"]]))
  
  -- 46. 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"]]))
  
  -- 47. Error: mtc.nr.comparisons with a single study (@test-unit-mtc.nr.comparis
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 48. Error: mtc.nr.comparisons with 2 studies (@test-unit-mtc.nr.comparisons.R
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 49. Error: mtc.study.treatment.matrix with 1 study (@test-unit-mtc.study.trea
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 50. Error: mtc.study.treatment.matrix with 2 studies (@test-unit-mtc.study.tr
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 51. Error: non-lexicographical treatment order works correctly (@test-unit-no
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. gemtc::mtc.network(data.ab = data.ab, treatments = treatments)
   2. gemtc:::mtc.network.validate(network)
   3. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 52. 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`(...)
  
  -- 53. 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"]]))
  
  -- 54. Error: read.mtc.network('luades-smoking.gemtc') has expected result (@tes
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. testthat::expect_that(read.mtc.network(file), equals(smoking))
   6. gemtc::read.mtc.network(file)
   7. gemtc::mtc.network(data.ab, treatments = treatments, description = description)
   8. gemtc:::mtc.network.validate(network)
   9. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 55. Error: read.mtc.network('parkinson.gemtc') has expected result (@test-uni
  all(all.treatments %in% network[["treatments"]][["id"]]) is not TRUE
  Backtrace:
   1. testthat::expect_that(read.mtc.network(file), equals(parkinson))
   6. gemtc::read.mtc.network(file)
   7. gemtc::mtc.network(data.ab, treatments = treatments, description = description)
   8. gemtc:::mtc.network.validate(network)
   9. base::stopifnot(all(all.treatments %in% network[["treatments"]][["id"]]))
  
  -- 56. 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: 230 | SKIPPED: 2 | WARNINGS: 0 | FAILED: 56 ]
  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: single pair-wise comparison gives FALSE (@test-unit-has.indirect.evidence.R#7) 
  9. Error: comparison in triangle gives TRUE (@test-unit-has.indirect.evidence.R#19) 
  1. ...
  
  Error: testthat unit tests failed
  In addition: Warning message:
  In extract_lang(f = comp_lang, y = quote(if (.isMethodsDispatchOn() &&  :
    devtools is incompatible with the current version of R. `load_all()` may function incorrectly.
  Execution halted