Running ‘bugBO.R’ [3s/6s]
  Running ‘bugKEEPdprime.R’ [3s/5s]
  Running ‘testBugResiduals.R’ [7s/11s]
  Running ‘testDprimes.R’ [8s/14s]
  Running ‘testKEEPeffs.R’ [25s/38s]
  Running ‘testRep.R’ [3s/6s]
Running the tests in ‘tests/testBugResiduals.R’ failed.
Complete output:
  > testOST <- FALSE
  > 
  > library(SensMixed)
  > load(system.file("testdata","bugResiddat.RData",package="SensMixed"))
  > load(system.file("testdata","bb.RData",package="SensMixed"))
  > load(system.file("testdata","ost.RData",package="SensMixed"))
  > 
  > response <- c("liking")
  > fixed <- list(Product = c("Sugar", "Acid"))
  > random <- c("consumer")
  > facs <- c("consumer", "Sugar", "Acid")
  > 
  > res <- conjoint(structure = 3, dat, response, fixed, random, facs)
  [1] "Calculating  liking ..."
  Number of levels for  interaction  consumer:Sugar:Acid is more or equal to the number of observations in data 
  
  Number of levels for  interaction  consumer:Sugar:Acid is more or equal to the number of observations in data 
  
  boundary (singular) fit: see ?isSingular
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  SensMixed
   --- call from context --- 
  calcSatterthMultDF(rho, L)
   --- call from argument --- 
  if (class(g) == "numeric") {
      lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
  } else {
      lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
  }
   --- R stacktrace ---
  where 1: calcSatterthMultDF(rho, L)
  where 2: calcSatt(rho, Lc)
  where 3: calcFpvalueSS(Lc, rho, ddf, type)
  where 4: calcFpvalueMAIN(term = tt, L = L, rho = rho, ddf = ddf, type = type)
  where 5: FUN(X[[i]], ...)
  where 6: lapply(test.terms, function(tt) calcFpvalueMAIN(term = tt, L = L, 
      rho = rho, ddf = ddf, type = type))
  where 7: stepFun(model = model, ddf = ddf, type = type, alpha.random = alpha.random, 
      alpha.fixed = alpha.fixed, reduce.fixed = reduce.fixed, reduce.random = reduce.random, 
      fixed.calc = fixed.calc, lsmeans.calc = lsmeans.calc, difflsmeans.calc = difflsmeans.calc, 
      test.effs = test.effs, keep.effs = keep.effs, change.contr = TRUE)
  where 8: step(model, reduce.fixed = isFixReduce, reduce.random = isRandReduce, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed)
  where 9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  where 10: suppressMessages(t <- step(model, reduce.fixed = isFixReduce, 
      reduce.random = isRandReduce, alpha.random = alpha.random, 
      alpha.fixed = alpha.fixed))
  where 11: conjointFun(structure = structure, data = data, response = response, 
      fixed = fixed, random = random, facs = facs, corr = FALSE, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed)
  where 12: conjoint(structure = 3, dat, response, fixed, random, facs)
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (rho, Lc) 
  {
      vcov.final <- as.matrix(vcov(rho$model))
      if (is.vector(Lc)) 
          C.theta.optim <- as.matrix(t(Lc) %*% vcov.final %*% Lc)
      else C.theta.optim <- as.matrix(Lc %*% vcov.final %*% t(Lc))
      invC.theta <- tryCatch({
          solve(C.theta.optim)
      }, error = function(e) {
          NULL
      })
      if (is.null(invC.theta)) 
          return(list(denom = 0, Fstat = NA, pvalue = NA, ndf = NA, 
              ss = NA, ms = NA))
      q <- qr(C.theta.optim)$rank
      F.stat <- (t(Lc %*% rho$fixEffs) %*% invC.theta %*% (Lc %*% 
          rho$fixEffs))/q
      svdec <- eigen(C.theta.optim)
      PL <- t(svdec$vectors) %*% Lc
      vss2 <- vcovTheta(rho$model)
      theopt <- c(rho$thopt, rho$sigma)
      g <- mygrad(function(x) vss2(x), theopt)
      mat.grad <- if (class(g) == "numeric") {
          lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
      }
      else {
          lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
      }
      nu.m.fun <- function(m) {
          den.nu <- unlist(lapply(1:length(mat.grad), function(i) as.matrix(t(PL[m, 
              ]) %*% mat.grad[[i]] %*% PL[m, ])))
          2 * (svdec$values[m])^2/(t(den.nu) %*% rho$A %*% den.nu)
      }
      nu.m <- unlist(lapply(1:length(svdec$values), nu.m.fun))
      nu.m[which(abs(2 - nu.m) < 1e-05)] <- 2.00001
      E <- sum((nu.m/(nu.m - 2)) * as.numeric(nu.m > 2))
      nu.F <- 2 * E * as.numeric(E > q)/(E - q)
      pvalueF <- pf(F.stat, qr(Lc)$rank, nu.F, lower.tail = FALSE)
      if (is.na(F.stat)) 
          ms <- ss <- NA
      else {
          ms <- F.stat * rho$sigma^2
          ss <- ms * q
      }
      return(list(ss = ss, ms = ms, denom = nu.F, Fstat = F.stat, 
          pvalue = pvalueF, ndf = q))
  }
  <bytecode: 0x564241a791b8>
  <environment: namespace:SensMixed>
   --- function search by body ---
  Function calcSatterthMultDF in namespace SensMixed has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(g) == "numeric") { : the condition has length > 1
  Calls: conjoint ... calcFpvalueMAIN -> calcFpvalueSS -> calcSatt -> calcSatterthMultDF
  Execution halted
Running the tests in ‘tests/testDprimes.R’ failed.
Complete output:
  > require(SensMixed)
  Loading required package: SensMixed
  > load(system.file("testdata","sensBObalanc.RData",package="SensMixed"))
  > load(system.file("testdata","sensBO.RData",package="SensMixed"))
  > testBO <- FALSE
  > ###########################################
  > ## check for TVbo without replication
  > ###########################################
  > 
  > 
  > 
  > TVbo <- convertToFactors(TVbo, c("Assessor", "Repeat", "Picture"))
  > result <- sensmixed(c("Noise", "Elasticeffect"),
  +                     prod_effects = c("TVset", "Picture"),
  +                     assessor = "Assessor", data = TVbo,
  +                     control = list(calc_post_hoc = TRUE), MAM = FALSE)
  
    |                                                                            
    |                                                                      |   0% ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  SensMixed
   --- call from context --- 
  calcSatterthMultDF(rho, L)
   --- call from argument --- 
  if (class(g) == "numeric") {
      lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
  } else {
      lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
  }
   --- R stacktrace ---
  where 1: calcSatterthMultDF(rho, L)
  where 2: calcSatt(rho, Lc)
  where 3: calcFpvalueSS(Lc, rho, ddf, type)
  where 4: calcFpvalueMAIN(term = tt, L = L, rho = rho, ddf = ddf, type = type)
  where 5: FUN(X[[i]], ...)
  where 6: lapply(test.terms, function(tt) calcFpvalueMAIN(term = tt, L = L, 
      rho = rho, ddf = ddf, type = type))
  where 7: stepFun(model = model, ddf = ddf, type = type, alpha.random = alpha.random, 
      alpha.fixed = alpha.fixed, reduce.fixed = reduce.fixed, reduce.random = reduce.random, 
      fixed.calc = fixed.calc, lsmeans.calc = lsmeans.calc, difflsmeans.calc = difflsmeans.calc, 
      test.effs = test.effs, keep.effs = keep.effs, change.contr = TRUE)
  where 8: step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
      difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs)
  where 9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  where 10: suppressMessages(st <- step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
      difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs))
  where 11: .fun(piece, ...)
  where 12: (function (i) 
  {
      piece <- pieces[[i]]
      if (.inform) {
          res <- try(.fun(piece, ...))
          if (inherits(res, "try-error")) {
              piece <- paste(utils::capture.output(print(piece)), 
                  collapse = "\n")
              stop("with piece ", i, ": \n", piece, call. = FALSE)
          }
      }
      else {
          res <- .fun(piece, ...)
      }
      progress$step()
      res
  })(1L)
  where 13: loop_apply(n, do.ply)
  where 14: llply(attributes, .stepAllAttrNoMAM, product_structure = product_structure, 
      error_structure = error_structure, data = data, prod_effects = prod_effects, 
      random = random, reduce.random = rmatch(control, "reduce.random"), 
      alpha.random = rmatch(control, "alpha.random"), alpha.fixed = rmatch(control, 
          "alpha.fixed"), calc_post_hoc = rmatch(control, "calc_post_hoc"), 
      keep.effs = keep.effs, .progress = "text")
  where 15: sensmixedFun(attributes = attributes, prod_effects = prod_effects, 
      assessor = assessor, replication = replication, data = data, 
      product_structure = product_structure, error_structure = error_structure, 
      MAM = MAM, control = control)
  where 16: sensmixed(c("Noise", "Elasticeffect"), prod_effects = c("TVset", 
      "Picture"), assessor = "Assessor", data = TVbo, control = list(calc_post_hoc = TRUE), 
      MAM = FALSE)
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (rho, Lc) 
  {
      vcov.final <- as.matrix(vcov(rho$model))
      if (is.vector(Lc)) 
          C.theta.optim <- as.matrix(t(Lc) %*% vcov.final %*% Lc)
      else C.theta.optim <- as.matrix(Lc %*% vcov.final %*% t(Lc))
      invC.theta <- tryCatch({
          solve(C.theta.optim)
      }, error = function(e) {
          NULL
      })
      if (is.null(invC.theta)) 
          return(list(denom = 0, Fstat = NA, pvalue = NA, ndf = NA, 
              ss = NA, ms = NA))
      q <- qr(C.theta.optim)$rank
      F.stat <- (t(Lc %*% rho$fixEffs) %*% invC.theta %*% (Lc %*% 
          rho$fixEffs))/q
      svdec <- eigen(C.theta.optim)
      PL <- t(svdec$vectors) %*% Lc
      vss2 <- vcovTheta(rho$model)
      theopt <- c(rho$thopt, rho$sigma)
      g <- mygrad(function(x) vss2(x), theopt)
      mat.grad <- if (class(g) == "numeric") {
          lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
      }
      else {
          lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
      }
      nu.m.fun <- function(m) {
          den.nu <- unlist(lapply(1:length(mat.grad), function(i) as.matrix(t(PL[m, 
              ]) %*% mat.grad[[i]] %*% PL[m, ])))
          2 * (svdec$values[m])^2/(t(den.nu) %*% rho$A %*% den.nu)
      }
      nu.m <- unlist(lapply(1:length(svdec$values), nu.m.fun))
      nu.m[which(abs(2 - nu.m) < 1e-05)] <- 2.00001
      E <- sum((nu.m/(nu.m - 2)) * as.numeric(nu.m > 2))
      nu.F <- 2 * E * as.numeric(E > q)/(E - q)
      pvalueF <- pf(F.stat, qr(Lc)$rank, nu.F, lower.tail = FALSE)
      if (is.na(F.stat)) 
          ms <- ss <- NA
      else {
          ms <- F.stat * rho$sigma^2
          ss <- ms * q
      }
      return(list(ss = ss, ms = ms, denom = nu.F, Fstat = F.stat, 
          pvalue = pvalueF, ndf = q))
  }
  <bytecode: 0x558849a2cda0>
  <environment: namespace:SensMixed>
   --- function search by body ---
  Function calcSatterthMultDF in namespace SensMixed has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(g) == "numeric") { : the condition has length > 1
  Calls: sensmixed ... calcFpvalueMAIN -> calcFpvalueSS -> calcSatt -> calcSatterthMultDF
  
  Execution halted
Running the tests in ‘tests/testKEEPeffs.R’ failed.
Complete output:
  > require(SensMixed)
  Loading required package: SensMixed
  > 
  > #convert some variables to factors in TVbo
  > TVbo <- convertToFactors(TVbo, c("Assessor", "Repeat", "Picture"))
  > 
  > res <- sensmixed(c("Coloursaturation", "Colourbalance"),
  +                  prod_effects = c("TVset", "Picture"), replication="Repeat", 
  +                  assessor="Assessor", data=TVbo, 
  +                  control = list(keep.effs = "Assessor"), MAM = FALSE)
  
  
    |                                                                            
    |                                                                      |   0%
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  SensMixed
   --- call from context --- 
  calcSatterthMultDF(rho, L)
   --- call from argument --- 
  if (class(g) == "numeric") {
      lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
  } else {
      lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
  }
   --- R stacktrace ---
  where 1: calcSatterthMultDF(rho, L)
  where 2: calcSatt(rho, Lc)
  where 3: calcFpvalueSS(Lc, rho, ddf, type)
  where 4: calcFpvalueMAIN(term = tt, L = L, rho = rho, ddf = ddf, type = type)
  where 5: FUN(X[[i]], ...)
  where 6: lapply(test.terms, function(tt) calcFpvalueMAIN(term = tt, L = L, 
      rho = rho, ddf = ddf, type = type))
  where 7: stepFun(model = model, ddf = ddf, type = type, alpha.random = alpha.random, 
      alpha.fixed = alpha.fixed, reduce.fixed = reduce.fixed, reduce.random = reduce.random, 
      fixed.calc = fixed.calc, lsmeans.calc = lsmeans.calc, difflsmeans.calc = difflsmeans.calc, 
      test.effs = test.effs, keep.effs = keep.effs, change.contr = TRUE)
  where 8: step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
      difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs)
  where 9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  where 10: suppressMessages(st <- step(m, reduce.fixed = FALSE, reduce.random = reduce.random, 
      alpha.random = alpha.random, alpha.fixed = alpha.fixed, lsmeans.calc = TRUE, 
      difflsmeans.calc = calc_post_hoc, keep.effs = keep.effs))
  where 11: .fun(piece, ...)
  where 12: (function (i) 
  {
      piece <- pieces[[i]]
      if (.inform) {
          res <- try(.fun(piece, ...))
          if (inherits(res, "try-error")) {
              piece <- paste(utils::capture.output(print(piece)), 
                  collapse = "\n")
              stop("with piece ", i, ": \n", piece, call. = FALSE)
          }
      }
      else {
          res <- .fun(piece, ...)
      }
      progress$step()
      res
  })(1L)
  where 13: loop_apply(n, do.ply)
  where 14: llply(attributes, .stepAllAttrNoMAM, product_structure = product_structure, 
      error_structure = error_structure, data = data, prod_effects = prod_effects, 
      random = random, reduce.random = rmatch(control, "reduce.random"), 
      alpha.random = rmatch(control, "alpha.random"), alpha.fixed = rmatch(control, 
          "alpha.fixed"), calc_post_hoc = rmatch(control, "calc_post_hoc"), 
      keep.effs = keep.effs, .progress = "text")
  where 15: sensmixedFun(attributes = attributes, prod_effects = prod_effects, 
      assessor = assessor, replication = replication, data = data, 
      product_structure = product_structure, error_structure = error_structure, 
      MAM = MAM, control = control)
  where 16: sensmixed(c("Coloursaturation", "Colourbalance"), prod_effects = c("TVset", 
      "Picture"), replication = "Repeat", assessor = "Assessor", 
      data = TVbo, control = list(keep.effs = "Assessor"), MAM = FALSE)
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (rho, Lc) 
  {
      vcov.final <- as.matrix(vcov(rho$model))
      if (is.vector(Lc)) 
          C.theta.optim <- as.matrix(t(Lc) %*% vcov.final %*% Lc)
      else C.theta.optim <- as.matrix(Lc %*% vcov.final %*% t(Lc))
      invC.theta <- tryCatch({
          solve(C.theta.optim)
      }, error = function(e) {
          NULL
      })
      if (is.null(invC.theta)) 
          return(list(denom = 0, Fstat = NA, pvalue = NA, ndf = NA, 
              ss = NA, ms = NA))
      q <- qr(C.theta.optim)$rank
      F.stat <- (t(Lc %*% rho$fixEffs) %*% invC.theta %*% (Lc %*% 
          rho$fixEffs))/q
      svdec <- eigen(C.theta.optim)
      PL <- t(svdec$vectors) %*% Lc
      vss2 <- vcovTheta(rho$model)
      theopt <- c(rho$thopt, rho$sigma)
      g <- mygrad(function(x) vss2(x), theopt)
      mat.grad <- if (class(g) == "numeric") {
          lapply(1:length(theopt), function(i) array(g[i], dim = dim(vcov.final)))
      }
      else {
          lapply(1:length(theopt), function(i) array(g[, i], dim = dim(vcov.final)))
      }
      nu.m.fun <- function(m) {
          den.nu <- unlist(lapply(1:length(mat.grad), function(i) as.matrix(t(PL[m, 
              ]) %*% mat.grad[[i]] %*% PL[m, ])))
          2 * (svdec$values[m])^2/(t(den.nu) %*% rho$A %*% den.nu)
      }
      nu.m <- unlist(lapply(1:length(svdec$values), nu.m.fun))
      nu.m[which(abs(2 - nu.m) < 1e-05)] <- 2.00001
      E <- sum((nu.m/(nu.m - 2)) * as.numeric(nu.m > 2))
      nu.F <- 2 * E * as.numeric(E > q)/(E - q)
      pvalueF <- pf(F.stat, qr(Lc)$rank, nu.F, lower.tail = FALSE)
      if (is.na(F.stat)) 
          ms <- ss <- NA
      else {
          ms <- F.stat * rho$sigma^2
          ss <- ms * q
      }
      return(list(ss = ss, ms = ms, denom = nu.F, Fstat = F.stat, 
          pvalue = pvalueF, ndf = q))
  }
  <bytecode: 0x5651d3ad33a0>
  <environment: namespace:SensMixed>
   --- function search by body ---
  Function calcSatterthMultDF in namespace SensMixed has this body.
   ----------- END OF FAILURE REPORT -------------- 
  Error in if (class(g) == "numeric") { : the condition has length > 1
  Calls: sensmixed ... calcFpvalueMAIN -> calcFpvalueSS -> calcSatt -> calcSatterthMultDF
  In addition: Warning messages:
  1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 0.00767249 (tol = 0.002, component 1)
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 0.00296669 (tol = 0.002, component 1)
  3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 0.0227178 (tol = 0.002, component 1)
  4: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  5: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  6: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 0.00329232 (tol = 0.002, component 1)
  
  Execution halted