Running ‘testthat.R’ [50s/75s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(easyalluvial)
  > 
  > test_check("easyalluvial")
  ── 1. Error: alluvial_long (@test_alluvial_long.R#12)  ─────────────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_long(...)
    9. tidyr::complete(., !!key, !!id)
   11. tidyr::replace_na(full, replace = fill)
   12. ellipsis::check_dots_used()
   14. ellipsis:::exit_handler(action)
   15. base::bquote(...)
  
  ── 2. Error: get_data_space (@test_alluvial_model_response.R#12)  ──────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::get_data_space(df, imp, degree = 3)
    2. easyalluvial::manip_bin_numerics(...)
    2. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    2. dplyr::distinct(.)
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
    9. tidyr::complete(., !!!map(names(df_top), as.name))
   11. tidyr::replace_na(full, replace = fill)
   12. ellipsis::check_dots_used()
   14. ellipsis:::exit_handler(action)
   15. base::bquote(...)
  
  ── 3. Error: pdp_methods (@test_alluvial_model_response.R#36)  ─────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::get_pdp_predictions(df, imp, m, degree = 3, bins = 5)
    2. easyalluvial::get_data_space(df, imp, degree, bins)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 4. Error: alluvial_model_response (@test_alluvial_model_response.R#58)  ─────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::get_data_space(df, imp, degree = 3)
    2. easyalluvial::manip_bin_numerics(...)
    2. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    2. dplyr::distinct(.)
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
    9. tidyr::complete(., !!!map(names(df_top), as.name))
   11. tidyr::replace_na(full, replace = fill)
   12. ellipsis::check_dots_used()
   14. ellipsis:::exit_handler(action)
   15. base::bquote(...)
  
  ── 5. Error: alluvial_model_response_caret (@test_alluvial_model_response.R#227)
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_model_response_caret(train, degree = 3)
    2. easyalluvial::get_data_space(...)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 6. Error: params_bin_numeric_pred (@test_alluvial_model_response.R#305)  ────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_model_response_caret(train, degree = 4)
    2. easyalluvial::get_data_space(...)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 7. Error: n_feats == degree (@test_alluvial_model_response.R#336)  ──────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::get_data_space(df, imp, degree = 3)
    2. easyalluvial::manip_bin_numerics(...)
    2. dplyr::distinct(.)
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    2. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    2. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
    9. tidyr::complete(., !!!map(names(df_top), as.name))
   11. tidyr::replace_na(full, replace = fill)
   12. ellipsis::check_dots_used()
   14. ellipsis:::exit_handler(action)
   15. base::bquote(...)
  
  [1] "Number of flows: 17245"
  [1] "Original Dataframe reduced to 32 %"
  [1] "Maximum weight of a single flow 0.4 %"
  ── 8. Error: manip_bin_numerics (@test_manip.R#47)  ────────────────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::manip_bin_numerics(data, bin_labels = "min_max")
   13. forcats::as_factor(mpg)
   14. ellipsis::check_dots_used()
   16. ellipsis:::exit_handler(action)
   17. base::bquote(...)
  
  ── 9. Error: manip_bin_numerics with vector (@test_manip.R#116)  ───────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::manip_bin_numerics(df, bin_labels = "min_max")
   13. forcats::as_factor(a)
   14. ellipsis::check_dots_used()
   16. ellipsis:::exit_handler(action)
   17. base::bquote(...)
  
  ── 10. Error: manip_bin_numerics_NA (@test_manip.R#144)  ───────────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial:::test_bin_labels("min_max")
   14. forcats::as_factor(x)
   15. ellipsis::check_dots_used()
   17. ellipsis:::exit_handler(action)
   18. base::bquote(...)
  
  ── 13. Error: (unknown) (@test_palette.R#3)  ───────────────────────────────────
  Internal error: Trace data is not square.
  Backtrace:
    1. testthat::test_check("easyalluvial")
    2. testthat:::test_package_dir(...)
    3. testthat::test_dir(...)
    4. testthat:::test_files(...)
   10. base::lapply(...)
   11. testthat:::FUN(X[[i]], ...)
   17. testthat::source_file(...)
   18. testthat:::test_code(NULL, exprs, env)
   27. [ base::eval(...) ] with 1 more call
   29. testthat::test_that(...)
       ...
   40. testthat:::o_apply(...)
   41. base::lapply(objects, function(x) x[[method]](...))
   42. testthat:::FUN(X[[i]], ...)
   43. x[[method]](...)
   47. testthat:::failure_summary(result, self$n_fail)
   50. testthat:::format.expectation(x)
   51. testthat:::format_with_trace(x)
   53. rlang:::format.rlang_trace(...)
   54. rlang:::trace_format_branch(x, max_frames, dir, srcrefs)
   55. rlang:::branch_uncollapse_pipe(trace)
  
  ── 14. Error: plot_imp (@test_plot_imp.R#14)  ──────────────────────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_model_response_caret(train, degree = 3)
    2. easyalluvial::get_data_space(...)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 15. Error: add_importance_plot (@test_plot_imp.R#35)  ───────────────────────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_model_response_caret(...)
    2. easyalluvial::get_data_space(...)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 16. Error: plot_hist_as_margins (@test_plot_marginal_histograms.R#31)  ──────
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_long(...)
   10. tidyr::complete(., !!key, !!id)
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ── 17. Error: model response marginal hists, extra columns in df (@test_plot_mar
  'where' must be an environment
  Backtrace:
    1. easyalluvial::alluvial_model_response_caret(train, degree = 3)
    2. easyalluvial::get_data_space(...)
    3. easyalluvial::manip_bin_numerics(...)
    3. dplyr::mutate_if(., is.factor, fct_lump, n = max_levels, other_level = "easyalluvial_factor_cap")
    3. dplyr::distinct(.)
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), ~as.numeric(as.character(.)))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = max))
    3. dplyr::bind_rows(., summarise_all(df_top, summarise_top, agg = min))
    3. dplyr::mutate_at(., vars(one_of(numerics_top)), as.factor)
   10. tidyr::complete(., !!!map(names(df_top), as.name))
   12. tidyr::replace_na(full, replace = fill)
   13. ellipsis::check_dots_used()
   15. ellipsis:::exit_handler(action)
   16. base::bquote(...)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 35 | SKIPPED: 12 | WARNINGS: 0 | FAILED: 17 ]
  1. Error: alluvial_long (@test_alluvial_long.R#12) 
  2. Error: get_data_space (@test_alluvial_model_response.R#12) 
  3. Error: pdp_methods (@test_alluvial_model_response.R#36) 
  4. Error: alluvial_model_response (@test_alluvial_model_response.R#58) 
  5. Error: alluvial_model_response_caret (@test_alluvial_model_response.R#227) 
  6. Error: params_bin_numeric_pred (@test_alluvial_model_response.R#305) 
  7. Error: n_feats == degree (@test_alluvial_model_response.R#336) 
  8. Error: manip_bin_numerics (@test_manip.R#47) 
  9. Error: manip_bin_numerics with vector (@test_manip.R#116) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted