Running ‘test-all.R’ [26s/26s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > #library("lava")
  > suppressPackageStartupMessages(library("testthat"))
  > test_check("lava")
  Loading required package: lava
  lava version 1.6.1
  
  Attaching package: 'lava'
  
  The following object is masked from 'package:testthat':
  
      compare
  
  ── 1. Error: Probit constraints (@test-constrain.R#62)  ────────────────────────
  non-character argument
  1: strsplit(sessionInfo()$otherPkgs$mets$Version, ".", fixed = TRUE) at testthat/test-constrain.R:62
  
  ── 2. Error: estimate.default (@test-estimate_default.R#7)  ────────────────────
  there is no package called 'mets'
  1: mets::fast.reshape at testthat/test-estimate_default.R:7
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 3. Error: Association measures (@test-inference.R#82)  ──────────────────────
  'mets' package required
  1: lava:::prob.normal(sigma = diag(nrow = 2), breaks = c(-Inf, 0), breaks2 = c(-Inf, 
         0)) at testthat/test-inference.R:82
  2: stop("'mets' package required")
  
  ── 4. Error: Prediction with missing data, random intercept (@test-inference.R#2
  there is no package called 'mets'
  1: mets::fast.reshape at testthat/test-inference.R:279
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 5. Error: Random slope model (@test-inference.R#309)  ───────────────────────
  there is no package called 'mets'
  1: mets::fast.reshape at testthat/test-inference.R:309
  2: getExportedValue(pkg, name)
  3: asNamespace(ns)
  4: getNamespace(ns)
  5: tryCatch(loadNamespace(name), error = function(e) stop(e))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  
  ── 6. Error: Weighted (@test-inference.R#490)  ─────────────────────────────────
  'mets' package required
  1: estimate(m, data = d, weights = d$w, estimator = "normal", control = list(trace = 1)) at testthat/test-inference.R:490
  2: estimate.lvm(m, data = d, weights = d$w, estimator = "normal", control = list(trace = 1))
  3: do.call(Optim$method, optarg)
  4: nlminb0(start = c(y = 0.200619689024182, `y~x` = 0, `y~~y` = 0.3372588334323), objective = function (pp) 
     {
         if (Optim$constrain) {
             pp[constrained] <- exp(pp[constrained])
         }
         offset <- MkOffset(pp)
         mu0 <- mu
         S0 <- S
         x0 <- x
         if (!is.null(offset)) {
             x0$constrain[iconstrain] <- NULL
             data0 <- data[, manifest(x0)]
             data0[, endogenous(x)] <- data0[, endogenous(x)] - offset
             pd <- procdata.lvm(x0, data = data0)
             S0 <- pd$S
             mu0 <- pd$mu
             x0$mean[yconstrain] <- 0
         }
         do.call(ObjectiveFun, list(x = x0, p = pp, data = data, S = S0, mu = mu0, n = n, 
             weights = weights, data2 = data2, offset = offset))
     }, gradient = function (pp) 
     {
         if (Optim$constrain) 
             pp[constrained] <- exp(pp[constrained])
         S <- do.call(GradFun, list(x = x, p = pp, data = data, S = S, mu = mu, n = n, 
             weights = weights, data2 = data2))
         if (Optim$constrain) {
             S[constrained] <- S[constrained] * pp[constrained]
         }
         if (is.null(mu) & index(x)$npar.mean > 0) {
             return(S[-c(seq_len(index(x)$npar.mean))])
         }
         if (length(S) < length(pp)) 
             S <- c(S, rep(0, length(pp) - length(S)))
         return(S)
     }, hessian = function (pp) 
     {
         p0 <- pp
         if (Optim$constrain) 
             pp[constrained] <- exp(pp[constrained])
         I0 <- myInfo(pp)
         attributes(I0)$grad <- NULL
         D <- attributes(I0)$grad
         if (is.null(D)) {
             D <- myGrad(p0)
             attributes(I0)$grad <- D
         }
         if (Optim$constrain) {
             I0[constrained, -constrained] <- apply(I0[constrained, -constrained, drop = FALSE], 
                 2, function(x) x * pp[constrained])
             I0[-constrained, constrained] <- t(I0[constrained, -constrained])
             if (sum(constrained) == 1) {
                 I0[constrained, constrained] <- I0[constrained, constrained] * outer(pp[constrained], 
                     pp[constrained]) - D[constrained]
             }
             else {
                 I0[constrained, constrained] <- I0[constrained, constrained] * outer(pp[constrained], 
                     pp[constrained]) - diag(D[constrained], ncol = length(constrained))
             }
         }
         return(I0)
     }, lower = c(-Inf, -Inf, -Inf), control = list(iter.max = 300, trace = 1, gamma = 1, 
         gamma2 = 1, ngamma = 0, backtrack = "wolfe", lambda = 0.05, abs.tol = 1e-09, 
         epsilon = 1e-10, delta = 1e-10, rel.tol = 1e-10, S.tol = 1e-05, stabil = FALSE, 
         start = c(y = 0.200619689024182, `y~x` = 0, `y~~y` = 0.3372588334323), constrain = FALSE, 
         method = "nlminb0", starterfun = "startvalues0", information = "E", meanstructure = TRUE, 
         sparse = FALSE, tol = 1e-06), debug = function (fun, text = "", condition = NULL, 
         signature = NULL) 
     {
         if (is.null(signature)) 
             .Internal(debug(fun, text, condition))
         else if (requireNamespace("methods")) 
             methods::.debugMethod(fun, text, condition, signature, once = FALSE)
         else stop("failed to load the methods package for debugging by signature")
     })
  5: nlminb2(start, objective, gradient = NULL, hessian = NULL, ...)
  6: do.call("nlminb", mypar)
  7: nlminb(start = c(y = 0.200619689024182, `y~x` = 0, `y~~y` = 0.3372588334323), objective = function (pp) 
     {
         if (Optim$constrain) {
             pp[constrained] <- exp(pp[constrained])
         }
         offset <- MkOffset(pp)
         mu0 <- mu
         S0 <- S
         x0 <- x
         if (!is.null(offset)) {
             x0$constrain[iconstrain] <- NULL
             data0 <- data[, manifest(x0)]
             data0[, endogenous(x)] <- data0[, endogenous(x)] - offset
             pd <- procdata.lvm(x0, data = data0)
             S0 <- pd$S
             mu0 <- pd$mu
             x0$mean[yconstrain] <- 0
         }
         do.call(ObjectiveFun, list(x = x0, p = pp, data = data, S = S0, mu = mu0, n = n, 
             weights = weights, data2 = data2, offset = offset))
     }, gradient = NULL, hessian = NULL, lower = c(-Inf, -Inf, -Inf), control = list(iter.max = 300, 
         trace = 1, abs.tol = 1e-09, rel.tol = 1e-10))
  8: objective(.par, ...)
  9: do.call(ObjectiveFun, list(x = x0, p = pp, data = data, S = S0, mu = mu0, n = n, 
         weights = weights, data2 = data2, offset = offset))
  10: normal_objective.lvm(x = structure(list(M = structure(c(0, 1, 0, 0), .Dim = c(2L, 
     2L), .Dimnames = list(c("y", "x"), c("y", "x"))), par = structure(c(NA_character_, 
     NA_character_, NA_character_, NA_character_), .Dim = c(2L, 2L), .Dimnames = list(
         c("y", "x"), c("y", "x"))), cov = structure(c(1, 0, 0, 1), .Dim = c(2L, 2L), .Dimnames = list(
         c("y", "x"), c("y", "x"))), covpar = structure(c(NA, NA, NA, NA), .Dim = c(2L, 
     2L), .Dimnames = list(c("y", "x"), c("y", "x"))), fix = structure(c(NA_real_, NA_real_, 
     NA_real_, NA_real_), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), 
         covfix = structure(c(NA, NA, NA, 1.02947578510841), .Dim = c(2L, 2L), .Dimnames = list(
             c("y", "x"), c("y", "x"))), latent = list(), mean = list(y = NA, x = 0.24884497101728), 
         index = list(vars = c("y", "x"), manifest = c("y", "x"), exogenous = "x", latent = NULL, 
             endogenous = "y", exo.idx = 2L, eta.idx = integer(0), exo.obsidx = 2L, endo.obsidx = 1L, 
             obs.idx = 1:2, endo.idx = 1L, M = structure(c(0, 1, 0, 0), .Dim = c(2L, 2L
             ), .Dimnames = list(c("y", "x"), c("y", "x"))), A = structure(c(0, 1, 0, 
             0), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), P = structure(c(1, 
             0, 0, 1.02947578510841), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), 
                 c("y", "x"))), P0 = structure(c(1, 0, 0, 0), .Dim = c(2L, 2L), .Dimnames = list(
                 c("y", "x"), c("y", "x"))), P1 = structure(c(1, 0, 0, 0), .Dim = c(2L, 
             2L), .Dimnames = list(c("y", "x"), c("y", "x"))), M0 = structure(c(0, 1, 
             0, 0), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), M1 = structure(c(0, 
             1, 0, 0), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), 
             v0 = c(1, 0), v1 = c(1, 0), e0 = numeric(0), e1 = numeric(0), npar = 2, npar.reg = 1, 
             npar.var = 1, npar.mean = 1, npar.ex = 0, constrain.par = NULL, parname.all = character(0), 
             parname = character(0), which.diag = c(y = 1L), covparname.all = logical(0), 
             covparname = logical(0), meanfixed = c(y = FALSE, x = TRUE), meannamed = c(y = FALSE, 
             x = FALSE), mparname.all = NULL, mparname = NULL, eparname.all = NULL, eparname = NULL, 
             J = structure(c(1, 0, 0, 1), .Dim = c(2L, 2L)), Jy = structure(c(1, 0), .Dim = 1:2), 
             px = structure(c(1, 0, 0, 0), .Dim = c(2L, 2L)), sparse = FALSE, mparname.idx = NULL, 
             covparname.idx = NULL, parname.reg.idx = NULL, parname.reg.tidx = NULL, mparname.all.idx = NULL, 
             eparname.all.idx = NULL, covparname.all.idx = NULL, parname.all.reg.idx = NULL, 
             parname.all.reg.tidx = NULL, Ik = structure(c(1, 0, 0, 1), .Dim = c(2L, 2L
             )), Im = structure(c(1, 0, 0, 1), .Dim = c(2L, 2L)), Kkk = NULL, dA = structure(c(0, 
             0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), .Dim = 4:3), dP = structure(c(0, 0, 0, 
             0, 0, 0, 0, 0, 1, 0, 0, 0), .Dim = 4:3), dv = structure(c(1, 0, 0, 0, 0, 
             0), .Dim = 2:3), mean = structure(c(1L, 1L), .Dim = 1:2, .Dimnames = list(
                 NULL, c("idxM", "pidxM"))), reg = structure(c(2, 2), .Dim = 1:2, .Dimnames = list(
                 NULL, c("idxA", "pidxA"))), cov = structure(c(1, 3), .Dim = 1:2, .Dimnames = list(
                 NULL, c("idxP", "pidxP"))), epar = structure(numeric(0), .Dim = c(0L, 
             2L), .Dimnames = list(NULL, c("idxE", "pidxE"))), parval = list(), constrain.idx = NULL, 
             parBelongsTo = list(mean = 1L, reg = 2, cov = 3, epar = numeric(0), cpar = numeric(0))), 
         exogenous = "x", constrain = list(), constrainY = list(), attributes = list(randomslope = list(), 
             survival = list(), parameter = list(), categorical = list(), distribution = list(), 
             nonlinear = list(), functional = list(), label = list(), heavytail = list(), 
             heavytail.couple = list()), noderender = list(fill = NULL, shape = NULL, 
             label = NULL), edgerender = list(lty = NULL, lwd = NULL, col = NULL, textCol = NULL, 
             est = NULL, arrowhead = NULL, dir = NULL, cex = NULL, futureinfo = list()), 
         graphrender = list(recipEdges = "distinct"), graphdef = list(fill = "white", 
             shape = "rectangle", label = expression(NA), lty = 1, lwd = 1, col = "black", 
             textCol = "black", est = 0, arrowhead = "open", dir = "forward", cex = 1.5, 
             label = expression(), futureinfo = NULL), parpos = list(A = structure(c(0, 
         2, 0, 0), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), P = structure(c(3, 
         0, 0, 0), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), v = c(y = 1, 
         x = 0), e = numeric(0), parval = list(), constrain.idx = NULL, constrainpar = NULL)), class = "lvm"), 
         p = c(y = 0.200619689024182, `y~x` = 0, `y~~y` = 0.3372588334323), data = structure(list(
             y = c(0.885327357708516, 0.573486560633513, -1.45686919295185, -0.619419085039708, 
             1.45443868995847, -0.865401993133246, 0.471238789329539, 1.68216091581452, 
             1.39700254675158, 0.288512934061153), x = c(1.51178116845085, 0.389843236411431, 
             -0.621240580541804, -2.2146998871775, 1.12493091814311, -0.0449336090152309, 
             -0.0161902630989461, 0.943836210685299, 0.821221195098089, 0.593901321217509
             ), w = c(0.838851664704271, 0.682354174437933, 0.804639486060478, 0.597732680477202, 
             0.576747622177936, 0.810420608520508, 0.120998082100414, 0.529507058532909, 
             0.75908236480318, 0.723458400834352)), row.names = c(NA, -10L), class = "data.frame"), 
         S = structure(c(1.0117765002969, 0.746434646025149, 0.746434646025149, 1.02947578510841
         ), .Dim = c(2L, 2L), .Dimnames = list(c("y", "x"), c("y", "x"))), mu = c(y = 0.381047752313248, 
         x = 0.24884497101728), n = 10L, weights = structure(c(0.838851664704271, 0.682354174437933, 
         0.804639486060478, 0.597732680477202, 0.576747622177936, 0.810420608520508, 0.120998082100414, 
         0.529507058532909, 0.75908236480318, 0.723458400834352), .Dim = c(10L, 1L), .Dimnames = list(
             NULL, "weights")), data2 = NULL, offset = NULL)
  11: stop("'mets' package required")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 228 SKIPPED: 8 FAILED: 6
  1. Error: Probit constraints (@test-constrain.R#62) 
  2. Error: estimate.default (@test-estimate_default.R#7) 
  3. Error: Association measures (@test-inference.R#82) 
  4. Error: Prediction with missing data, random intercept (@test-inference.R#279) 
  5. Error: Random slope model (@test-inference.R#309) 
  6. Error: Weighted (@test-inference.R#490) 
  
  Error: testthat unit tests failed
  Execution halted