Running ‘testthat.R’ [34s/32s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(edarf)
  > 
  > set.seed(1987)
  > 
  > nperm <- 2L
  > n <- 50
  > 
  > X1 <- rnorm(n)
  > X2 <- rnorm(n)
  > X3 <- as.ordered(sample(1:3, n, TRUE))
  > b3 <- runif(3, -1, 1)
  > 
  > df_regr <- data.frame(X1, X2, X3, "y" = rowSums(poly(X1)) * X2 + model.matrix( ~ -1 + as.factor(X3)) %*% b3)
  > df_classif <- data.frame(X1, X2, X3, "y" = as.factor(ifelse(df_regr$y > median(df_regr$y), 1, 0)))
  > df_multi <- data.frame("yr" = df_regr$y, "yc" = df_classif$y, X1, X2, X3)
  > 
  > library(randomForest)
  randomForest 4.6-14
  Type rfNews() to see new features/changes/bug fixes.
  > library(randomForestSRC)
  
   randomForestSRC 2.9.3 
   
   Type rfsrc.news() to see new features, changes, and bug fixes. 
   
  
  > library(party)
  Loading required package: grid
  Loading required package: mvtnorm
  Loading required package: modeltools
  Loading required package: stats4
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  > library(ranger)
  
  Attaching package: 'ranger'
  
  The following object is masked from 'package:randomForest':
  
      importance
  
  > 
  > fits_regr <- list(
  +   randomForest(y ~ ., df_regr, proximity = TRUE),
  +   randomForest(df_regr[, -which(colnames(df_regr) == "y")], df_regr$y, proximity = TRUE),
  +   cforest(y ~ ., df_regr, controls = cforest_control(mtry = 1)),
  +   rfsrc(y ~ ., df_regr, proximity = "inbag"),
  +   ranger(y ~ ., df_regr, write.forest = TRUE)
  + )
  > 
  > fits_classif <- list(
  +   randomForest(y ~ ., df_classif, proximity = TRUE),
  +   randomForest(df_classif[, -which(colnames(df_classif) == "y")], df_classif$y, proximity = TRUE),
  +   cforest(y ~ ., df_classif, controls = cforest_control(mtry = 1)),
  +   rfsrc(y ~ ., df_classif, proximity = "inbag"),
  +   ranger(y ~ ., df_classif, write.forest = TRUE)
  + )
  > 
  > fits_multi <- list(
  +   cforest(yr + yc ~ ., df_multi, controls = cforest_control(mtry = 1))
  + )
  > 
  > test_check("edarf")
  ── 1. Error: regression (@test_pd.R#3)  ────────────────────────────────────────
  The melt generic in data.table has been passed a pd, but data.table::melt currently only has a method for data.tables. Please confirm your input is a data.table, with setDT(pd) or as.data.table(pd). If you intend to use a method from reshape2, try installing that package first, but do note that reshape2 is deprecated and you should be migrating your code away from using it.
  Backtrace:
   1. base::lapply(...)
   2. edarf:::FUN(X[[i]], ...)
   3. edarf::plot_pd(pd)
   4. data.table::melt(pd, id.vars = c(atts$target, facet), na.rm = TRUE)
   5. base::tryCatch(...)
   6. base:::tryCatchList(expr, classes, parentenv, handlers)
   7. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   8. value[[3L]](cond)
  
  ── 2. Error: classification (@test_pd.R#27)  ───────────────────────────────────
  The melt generic in data.table has been passed a pd, but data.table::melt currently only has a method for data.tables. Please confirm your input is a data.table, with setDT(pd) or as.data.table(pd). If you intend to use a method from reshape2, try installing that package first, but do note that reshape2 is deprecated and you should be migrating your code away from using it.
  Backtrace:
   1. base::lapply(...)
   2. edarf:::FUN(X[[i]], ...)
   3. edarf::plot_pd(pd)
   4. data.table::melt(pd, id.vars = c(atts$target, facet), na.rm = TRUE)
   5. base::tryCatch(...)
   6. base:::tryCatchList(expr, classes, parentenv, handlers)
   7. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   8. value[[3L]](cond)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 60 | SKIPPED: 0 | WARNINGS: 15 | FAILED: 2 ]
  1. Error: regression (@test_pd.R#3) 
  2. Error: classification (@test_pd.R#27) 
  
  Error: testthat unit tests failed
  Execution halted