Running 'testthat.R' [22s]
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.7.0 
   
   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 (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead.
  1: lapply(fits_regr, function(fit) {
         pd <- partial_dependence(fit, "X1", n, data = df_regr)
         expect_that(pd, is_a("data.frame"))
         expect_that(any(c("y", "prediction") %in% colnames(pd)), is_true())
         expect_that(pd$X1, is_a("numeric"))
         expect_that(all(sapply(pd, class) == "numeric"), is_true())
         expect_that(nrow(pd), equals(10))
         plot_pd(pd)
         pd_int <- partial_dependence(fit, c("X1", "X3"), n, TRUE, data = df_regr)
         expect_that(any(c("y", "prediction") %in% colnames(pd_int)), is_true())
         expect_that(pd_int$X1, is_a("numeric"))
         expect_that(pd_int$X3, is_a("ordered"))
         plot_pd(pd_int, "X3")
         pd_both <- partial_dependence(fit, c("X1", "X3"), n, FALSE, data = df_regr)
         expect_that(any(c("y", "prediction") %in% colnames(pd_both)), is_true())
         expect_that(all(c("X1", "X3") %in% colnames(pd_both)), is_true())
         expect_warning(plot_pd(pd_both))
     }) at testthat/test_pd.R:3
  2: FUN(X[[i]], ...)
  3: plot_pd(pd) at testthat/test_pd.R:10
  4: melt(pd, id.vars = c(atts$target, facet), na.rm = TRUE)
  5: tryCatch(getNamespace("reshape2"), error = function(e) stop("The melt generic in data.table has been passed a ", 
         class(data)[1L], " (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead."))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  9: stop("The melt generic in data.table has been passed a ", class(data)[1L], " (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead.")
  
  -- 2. Error: classification (@test_pd.R#27)  -----------------------------------
  The melt generic in data.table has been passed a pd (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead.
  1: lapply(fits_classif, function(fit) {
         pd <- partial_dependence(fit, "X1", n, data = df_classif)
         expect_that(colnames(pd), equals(c("X1", "0", "1")))
         expect_that(all(sapply(pd, class) == "numeric"), is_true())
         plot_pd(pd)
         pd_int <- partial_dependence(fit, c("X1", "X3"), n, interaction = TRUE, data = df_classif)
         expect_that(colnames(pd_int), equals(c("X1", "X3", "0", "1")))
         plot_pd(pd_int, "X3")
         plot_pd(pd_int)
         pd_lst <- partial_dependence(fit, c("X1", "X3"), n, data = df_classif)
         expect_that(colnames(pd_lst), equals(c("X1", "X3", "0", "1")))
         expect_warning(plot_pd(pd_lst))
     }) at testthat/test_pd.R:27
  2: FUN(X[[i]], ...)
  3: plot_pd(pd) at testthat/test_pd.R:31
  4: melt(pd, id.vars = c(atts$target, facet), na.rm = TRUE)
  5: tryCatch(getNamespace("reshape2"), error = function(e) stop("The melt generic in data.table has been passed a ", 
         class(data)[1L], " (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead."))
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  9: stop("The melt generic in data.table has been passed a ", class(data)[1L], " (not a data.table) but the reshape2 package is not installed to process this type. Please either install reshape2 and try again, or pass a data.table to melt instead.")
  
  == testthat results  ===========================================================
  OK: 60 SKIPPED: 0 FAILED: 2
  1. Error: regression (@test_pd.R#3) 
  2. Error: classification (@test_pd.R#27) 
  
  Error: testthat unit tests failed
  Execution halted