Running 'testthat.R' [46s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(distr6)
  
  -----------------------------
  	distr6 v1.2.0
  
  Get started:	?distr6
  Changelog:	distr6News()
  -----------------------------
  
  
  Attaching package: 'distr6'
  
  The following object is masked from 'package:grDevices':
  
      pdf
  
  The following objects are masked from 'package:base':
  
      mode, truncate
  
  > 
  > test_check("distr6")
  -- 1. Error: print (@test-Distributions.R#94)  ---------------------------------
  not a function
  1: expect_equal(print(VectorDistribution$new(distribution = Bernoulli, params = list(list(prob = 0.2), 
         list(prob = 0.8), list(prob = 0.1), list(prob = 0.9), list(prob = 0.67)))), VectorDistribution$new(distribution = Bernoulli, 
         params = list(list(prob = 0.2), list(prob = 0.8), list(prob = 0.1), list(prob = 0.9), 
             list(prob = 0.67)))$print(2)) at testthat/test-Distributions.R:94
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: print(VectorDistribution$new(distribution = Bernoulli, params = list(list(prob = 0.2), 
         list(prob = 0.8), list(prob = 0.1), list(prob = 0.9), list(prob = 0.67))))
  5: VectorDistribution$new(distribution = Bernoulli, params = list(list(prob = 0.2), 
         list(prob = 0.8), list(prob = 0.1), list(prob = 0.9), list(prob = 0.67)))
  6: .subset2(public_bind_env, "initialize")(...)
  7: makeUniqueDistributions(distlist)
  8: lapply(distlist, function(x) return(x$clone()))
  9: FUN(X[[i]], ...)
  10: x$clone()
  11: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  12: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 2. Error: constructor (@test-ProductDistribution.R#6)  ----------------------
  not a function
  1: expect_silent(ProductDistribution$new(list(Binomial$new(), Binomial$new(size = 20, 
         prob = 0.6)))) at testthat/test-ProductDistribution.R:6
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: ProductDistribution$new(list(Binomial$new(), Binomial$new(size = 20, prob = 0.6)))
  10: .subset2(public_bind_env, "initialize")(...)
  11: makeUniqueDistributions(distlist)
  12: lapply(distlist, function(x) return(x$clone()))
  13: FUN(X[[i]], ...)
  14: x$clone()
  15: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  16: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 3. Error: type/support (@test-ProductDistribution.R#15)  --------------------
  not a function
  1: expect_equal(ProductDistribution$new(list(Binomial$new(), Binomial$new()))$type()$getSymbol(), 
         Naturals$new(2)$getSymbol()) at testthat/test-ProductDistribution.R:15
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ProductDistribution$new(list(Binomial$new(), Binomial$new()))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 4. Error: pdf/cdf (@test-ProductDistribution.R#21)  -------------------------
  not a function
  1: expect_equal(ProductDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))$pdf(4, x2 = 8), Binomial$new(size = 40, prob = 0.2)$pdf(4) * Binomial$new(size = 5, 
         prob = 0.9)$pdf(8)) at testthat/test-ProductDistribution.R:21
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ProductDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 5. Error: rand (@test-ProductDistribution.R#30)  ----------------------------
  not a function
  1: expect_equal(dim(ProductDistribution$new(list(Binomial$new(size = 40, prob = 0.2), 
         Binomial$new(size = 5, prob = 0.9)))$rand(5)), c(5, 2)) at testthat/test-ProductDistribution.R:30
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ProductDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 6. Error: pdf/cdf - array (@test-ProductDistribution.R#35)  -----------------
  not a function
  1: ProductDistribution$new(distribution = Binomial, params = list(list(prob = 0.1, size = 2), 
         list(prob = 0.6, size = 4), list(prob = 0.2, size = 6))) at testthat/test-ProductDistribution.R:35
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 7. Error: type/support - array (@test-ProductDistribution.R#42)  ------------
  not a function
  1: ProductDistribution$new(distribution = Binomial, params = list(list(prob = 0.1, size = 2), 
         list(prob = 0.6, size = 4), list(prob = 0.2, size = 6))) at testthat/test-ProductDistribution.R:42
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 8. Error: constructor (@test-VectorDistribution.R#6)  -----------------------
  not a function
  1: expect_silent(VectorDistribution$new(list(Binomial$new(), Binomial$new(size = 20, 
         prob = 0.6)))) at testthat/test-VectorDistribution.R:6
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: VectorDistribution$new(list(Binomial$new(), Binomial$new(size = 20, prob = 0.6)))
  10: .subset2(public_bind_env, "initialize")(...)
  11: makeUniqueDistributions(distlist)
  12: lapply(distlist, function(x) return(x$clone()))
  13: FUN(X[[i]], ...)
  14: x$clone()
  15: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  16: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 9. Error: type/support (@test-VectorDistribution.R#11)  ---------------------
  not a function
  1: expect_equal(VectorDistribution$new(list(Binomial$new(), Binomial$new()))$type()$getSymbol(), 
         Naturals$new(2)$getSymbol()) at testthat/test-VectorDistribution.R:11
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: VectorDistribution$new(list(Binomial$new(), Binomial$new()))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 10. Error: pdf/cdf/quantile (@test-VectorDistribution.R#17)  ----------------
  not a function
  1: expect_equal(VectorDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))$pdf(4, 8), data.table::data.table(Binom1 = dbinom(4, 40, 0.2), 
         Binom2 = dbinom(8, 5, 0.9))) at testthat/test-VectorDistribution.R:17
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: VectorDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 11. Error: rand (@test-VectorDistribution.R#30)  ----------------------------
  not a function
  1: expect_equal(dim(VectorDistribution$new(list(Binomial$new(size = 40, prob = 0.2), 
         Binomial$new(size = 5, prob = 0.9)))$rand(5)), c(5, 2)) at testthat/test-VectorDistribution.R:30
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: VectorDistribution$new(list(Binomial$new(size = 40, prob = 0.2), Binomial$new(size = 5, 
         prob = 0.9)))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 12. Error: pdf/cdf - array (@test-VectorDistribution.R#38)  -----------------
  not a function
  1: VectorDistribution$new(distribution = Binomial, params = list(list(prob = 0.1, size = 2), 
         list(prob = 0.6, size = 4), list(prob = 0.2, size = 6))) at testthat/test-VectorDistribution.R:38
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 13. Error: type/support - array (@test-VectorDistribution.R#45)  ------------
  not a function
  1: VectorDistribution$new(distribution = Binomial, params = list(list(prob = 0.1, size = 2), 
         list(prob = 0.6, size = 4), list(prob = 0.2, size = 6))) at testthat/test-VectorDistribution.R:45
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 14. Error: continuous add (@test-convolution.R#8)  --------------------------
  not a function
  1: expect_equal(round(Convolution$new(Exp1, Exp2)$pdf(1:5), 4), round(dgamma(x = 1:5, 
         shape = 2), 4)) at testthat/test-convolution.R:8
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: Convolution$new(Exp1, Exp2)
  5: .subset2(public_bind_env, "initialize")(...)
  6: dist1$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 15. Error: continuous subtract (@test-convolution.R#14)  --------------------
  not a function
  1: expect_equal(round(Convolution$new(N1, N2, add = FALSE)$pdf(1:5), 4), round(dnorm(1:5, 
         1, sqrt(2)), 4)) at testthat/test-convolution.R:14
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: Convolution$new(N1, N2, add = FALSE)
  5: .subset2(public_bind_env, "initialize")(...)
  6: dist1$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 16. Error: discrete add (@test-convolution.R#20)  ---------------------------
  not a function
  1: `+.Distribution`(Bern1, Bern2) at testthat/test-convolution.R:20
  2: Convolution$new(dist1, dist2, add = TRUE)
  3: .subset2(public_bind_env, "initialize")(...)
  4: dist1$clone()
  5: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  6: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 17. Error: unique distributions (@test-distributionHelpers.R#27)  -----------
  not a function
  1: expect_silent(makeUniqueDistributions(list(Binomial$new(), Binomial$new()))$Binom1) at testthat/test-distributionHelpers.R:27
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: makeUniqueDistributions(list(Binomial$new(), Binomial$new()))
  10: lapply(distlist, function(x) return(x$clone()))
  11: FUN(X[[i]], ...)
  12: x$clone()
  13: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  14: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 18. Error: check huberization constructor (@test-huberization.R#33)  --------
  not a function
  1: expect_message(huberize(MixtureDistribution$new(list(Binomial$new(), Normal$new())), 
         1, 2)) at testthat/test-huberization.R:33
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: huberize(MixtureDistribution$new(list(Binomial$new(), Normal$new())), 1, 2)
  7: MixtureDistribution$new(list(Binomial$new(), Normal$new()))
  8: .subset2(public_bind_env, "initialize")(...)
  9: makeUniqueDistributions(distlist)
  10: lapply(distlist, function(x) return(x$clone()))
  11: FUN(X[[i]], ...)
  12: x$clone()
  13: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  14: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 19. Error: check weights (@test-mixture.R#6)  -------------------------------
  not a function
  1: expect_equal(MixtureDistribution$new(list(Exponential$new(), Normal$new()))$.__enclos_env__$private$.weights, 
         "uniform") at testthat/test-mixture.R:6
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: MixtureDistribution$new(list(Exponential$new(), Normal$new()))
  5: .subset2(public_bind_env, "initialize")(...)
  6: makeUniqueDistributions(distlist)
  7: lapply(distlist, function(x) return(x$clone()))
  8: FUN(X[[i]], ...)
  9: x$clone()
  10: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  11: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 20. Error: (unknown) (@test-mixture.R#13)  ----------------------------------
  not a function
  1: MixtureDistribution$new(list(Binomial$new(), Exponential$new(), Normal$new()), weights = c(0.1, 
         0.6, 0.3)) at testthat/test-mixture.R:13
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 21. Error: wrapped models (@test-wrapper.R#19)  -----------------------------
  not a function
  1: VectorDistribution$new(list(Binomial$new(), Normal$new())) at testthat/test-wrapper.R:19
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 22. Error: unique parameters (@test-wrapper.R#26)  --------------------------
  not a function
  1: VectorDistribution$new(list(Normal$new(), Normal$new())) at testthat/test-wrapper.R:26
  2: .subset2(public_bind_env, "initialize")(...)
  3: makeUniqueDistributions(distlist)
  4: lapply(distlist, function(x) return(x$clone()))
  5: FUN(X[[i]], ...)
  6: x$clone()
  7: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  8: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  -- 23. Error: wrap a wrapper (@test-wrapper.R#35)  -----------------------------
  not a function
  1: expect_silent(VectorDistribution$new(list(ProductDistribution$new(list(MixtureDistribution$new(list(Exponential$new(), 
         huberize(truncate(Normal$new(), lower = -10, upper = 10), -5, 5))), VectorDistribution$new(distribution = Gompertz, 
         params = list(list(shape = 2, scale = 4), list(shape = 1, scale = 5))))), Binomial$new()))) at testthat/test-wrapper.R:35
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: VectorDistribution$new(list(ProductDistribution$new(list(MixtureDistribution$new(list(Exponential$new(), 
         huberize(truncate(Normal$new(), lower = -10, upper = 10), -5, 5))), VectorDistribution$new(distribution = Gompertz, 
         params = list(list(shape = 2, scale = 4), list(shape = 1, scale = 5))))), Binomial$new()))
  10: .subset2(public_bind_env, "initialize")(...)
  11: ProductDistribution$new(list(MixtureDistribution$new(list(Exponential$new(), huberize(truncate(Normal$new(), 
         lower = -10, upper = 10), -5, 5))), VectorDistribution$new(distribution = Gompertz, 
         params = list(list(shape = 2, scale = 4), list(shape = 1, scale = 5)))))
  12: .subset2(public_bind_env, "initialize")(...)
  13: MixtureDistribution$new(list(Exponential$new(), huberize(truncate(Normal$new(), lower = -10, 
         upper = 10), -5, 5)))
  14: .subset2(public_bind_env, "initialize")(...)
  15: makeUniqueDistributions(distlist)
  16: lapply(distlist, function(x) return(x$clone()))
  17: FUN(X[[i]], ...)
  18: x$clone()
  19: copy_slice(old[[i]], new[[i]], old_new_enclosing_pairs[seq.int(i, length(old))], 
         (i == 1))
  20: makeActiveBinding(name, active_copies[[name]], new_slice$binding)
  
  == testthat results  ===========================================================
  [ OK: 2035 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 23 ]
  1. Error: print (@test-Distributions.R#94) 
  2. Error: constructor (@test-ProductDistribution.R#6) 
  3. Error: type/support (@test-ProductDistribution.R#15) 
  4. Error: pdf/cdf (@test-ProductDistribution.R#21) 
  5. Error: rand (@test-ProductDistribution.R#30) 
  6. Error: pdf/cdf - array (@test-ProductDistribution.R#35) 
  7. Error: type/support - array (@test-ProductDistribution.R#42) 
  8. Error: constructor (@test-VectorDistribution.R#6) 
  9. Error: type/support (@test-VectorDistribution.R#11) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted