Running ‘testthat.R’ [6s/12s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(widyr)
  > 
  > test_check("widyr")
  [ FAIL 6 | WARN 1 | SKIP 0 | PASS 40 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-pairwise-count.R:16:3): pairing and counting works ──────────────
  Error in ``colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))`: attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─original %>% ... at test-pairwise-count.R:16:2
    2. ├─widyr::pairwise_count(...)
    3. │ └─widyr::pairwise_count_(...)
    4. │   └─... %>% rename(n = value)
    5. ├─dplyr::rename(., n = value)
    6. ├─widyr (local) func(., item, feature, wt)
    7. │ └─widyr (local) new_f(tbl, item, feature, value, ...)
    8. │   └─output %>% custom_melt() %>% as_tibble()
    9. ├─tibble::as_tibble(.)
   10. └─widyr:::custom_melt(.)
   11.   └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
  ── Error (test-pairwise-count.R:63:3): We can count with a weight column ───────
  Error in ``colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))`: attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─widyr::pairwise_count(d, col2, col1) at test-pairwise-count.R:63:2
    2. │ └─widyr::pairwise_count_(...)
    3. │   └─... %>% rename(n = value)
    4. ├─dplyr::rename(., n = value)
    5. ├─widyr (local) func(., item, feature, wt)
    6. │ └─widyr (local) new_f(tbl, item, feature, value, ...)
    7. │   └─output %>% custom_melt() %>% as_tibble()
    8. ├─tibble::as_tibble(.)
    9. └─widyr:::custom_melt(.)
   10.   └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
  ── Error (test-pairwise-count.R:79:5): Counts co-occurrences of words in Pride & Prejudice ──
  Error in ``colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))`: attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─words %>% ... at test-pairwise-count.R:79:4
    2. ├─widyr::pairwise_count(...)
    3. │ └─widyr::pairwise_count_(...)
    4. │   └─... %>% rename(n = value)
    5. ├─dplyr::rename(., n = value)
    6. ├─widyr (local) func(., item, feature, wt)
    7. │ └─widyr (local) new_f(tbl, item, feature, value, ...)
    8. │   └─output %>% custom_melt() %>% as_tibble()
    9. ├─tibble::as_tibble(.)
   10. └─widyr:::custom_melt(.)
   11.   └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
  ── Error (test-pairwise-count.R:104:3): Can count within groups ────────────────
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `mutate(., data = purrr::map(data, f, item, feature, value))`: Problem while computing `data = purrr::map(data, f, item, feature,
  value)`.
  ℹ The error occurred in group 1: cyl = 4.
  Caused by error in `colnames<-`:
  ! attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─mtcars %>% group_by(cyl) %>% pairwise_count(vs, am) at test-pairwise-count.R:104:2
    2. ├─widyr::pairwise_count(., vs, am)
    3. │ └─widyr::pairwise_count_(...)
    4. │   └─... %>% rename(n = value)
    5. ├─dplyr::rename(., n = value)
    6. ├─widyr (local) func(., item, feature, wt)
    7. │ └─... %>% dplyr::group_by_at(dplyr::group_vars(tbl))
    8. ├─dplyr::group_by_at(., dplyr::group_vars(tbl))
    9. │ └─dplyr:::manip_at(...)
   10. │   └─dplyr:::tbl_at_syms(...)
   11. │     └─dplyr:::tbl_at_vars(...)
   12. │       └─dplyr::tbl_vars(tbl)
   13. │         ├─dplyr:::new_sel_vars(tbl_vars_dispatch(x), group_vars(x))
   14. │         │ └─base::structure(...)
   15. │         └─dplyr:::tbl_vars_dispatch(x)
   16. ├─tidyr::unnest(., data)
   17. ├─dplyr::filter(., purrr::map_lgl(data, ~nrow(.) > 0))
   18. ├─dplyr::mutate(., data = purrr::map(data, f, item, feature, value))
   19. ├─dplyr:::mutate.data.frame(., data = purrr::map(data, f, item, feature, value))
   20. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())
   21. │   ├─base::withCallingHandlers(...)
   22. │   └─mask$eval_all_mutate(quo)
   23. ├─purrr::map(data, f, item, feature, value)
   24. │ └─widyr (local) .f(.x[[i]], ...)
   25. │   └─widyr (local) new_f(tbl, item, feature, value, ...)
   26. │     └─output %>% custom_melt() %>% as_tibble()
   27. ├─tibble::as_tibble(.)
   28. ├─widyr:::custom_melt(.)
   29. │ └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
   30. │   └─base::stop("attempt to set 'colnames' on an object with less than two dimensions")
   31. └─base::.handleSimpleError(...)
   32.   └─dplyr (local) h(simpleError(msg, call))
   33.     └─rlang::abort(...)
  ── Error (test-pairwise-similarity.R:14:3): pairwise_similarity computes pairwise cosine similarity ──
  Error in ``colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))`: attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─d %>% pairwise_similarity(col, row, value) at test-pairwise-similarity.R:14:2
    2. ├─widyr::pairwise_similarity(., col, row, value)
    3. │ └─widyr::pairwise_similarity_(...)
    4. │   └─tbl %>% d_func(item, feature, value) %>% rename(similarity = value)
    5. ├─dplyr::rename(., similarity = value)
    6. ├─widyr (local) d_func(., item, feature, value)
    7. │ └─widyr (local) new_f(tbl, item, feature, value, ...)
    8. │   └─output %>% custom_melt() %>% as_tibble()
    9. ├─tibble::as_tibble(.)
   10. └─widyr:::custom_melt(.)
   11.   └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
  ── Error (test-pairwise-similarity.R:29:3): pairwise_similarity retains factor levels ──
  Error in ``colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))`: attempt to set 'colnames' on an object with less than two dimensions
  Backtrace:
       ▆
    1. ├─d %>% pairwise_similarity(col, row, value) at test-pairwise-similarity.R:29:2
    2. ├─widyr::pairwise_similarity(., col, row, value)
    3. │ └─widyr::pairwise_similarity_(...)
    4. │   └─tbl %>% d_func(item, feature, value) %>% rename(similarity = value)
    5. ├─dplyr::rename(., similarity = value)
    6. ├─widyr (local) d_func(., item, feature, value)
    7. │ └─widyr (local) new_f(tbl, item, feature, value, ...)
    8. │   └─output %>% custom_melt() %>% as_tibble()
    9. ├─tibble::as_tibble(.)
   10. └─widyr:::custom_melt(.)
   11.   └─base::`colnames<-`(`*tmp*`, value = c("item1", "item2", "value"))
  
  [ FAIL 6 | WARN 1 | SKIP 0 | PASS 40 ]
  Error: Test failures
  Execution halted