Running 'testthat.R' [74s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(iNZightTools)
  
  Attaching package: 'iNZightTools'
  
  The following object is masked from 'package:stats':
  
      filter
  
  > 
  > test_check("iNZightTools")
  Loading required package: survey
  Loading required package: grid
  Loading required package: Matrix
  Loading required package: survival
  
  Attaching package: 'survey'
  
  The following object is masked from 'package:graphics':
  
      dotchart
  
  
  Attaching package: 'magrittr'
  
  The following objects are masked from 'package:testthat':
  
      equals, is_less_than, not
  
  Loading required namespace: styler
  Failed with error:  '.onLoad failed in loadNamespace() for 'styler', details:
    call: .difftime(tim, units = units)
    error: could not find function ".difftime"'
  In addition: There were 50 or more warnings (use warnings() to see the first 50)
  Loading required namespace: styler
  Failed with error:  '.onLoad failed in loadNamespace() for 'styler', details:
    call: .difftime(tim, units = units)
    error: could not find function ".difftime"'
  Loading required namespace: styler
  Failed with error:  '.onLoad failed in loadNamespace() for 'styler', details:
    call: .difftime(tim, units = units)
    error: could not find function ".difftime"'
  Loading required namespace: styler
  Failed with error:  '.onLoad failed in loadNamespace() for 'styler', details:
    call: .difftime(tim, units = units)
    error: could not find function ".difftime"'
  Loading required namespace: styler
  Failed with error:  '.onLoad failed in loadNamespace() for 'styler', details:
    call: .difftime(tim, units = units)
    error: could not find function ".difftime"'
  [ FAIL 7 | WARN 1295 | SKIP 4 | PASS 352 ]
  
  ══ Skipped tests (4) ═══════════════════════════════════════════════════════════
  • On CRAN (2): 'test_smart_read.R:27:5', 'test_smart_read.R:253:5'
  • URL not available. (1): 'test_smart_read.R:203:5'
  • surveyspec cannot be loaded (1): 'test_survey_design.R:4:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_tidy_code.R:5:5'): Cody tidying does not break code ────────────
  Error in `FUN(X[[i]], ...)`: Please install suggested package: 'styler'
  Backtrace:
      ▆
   1. └─iNZightTools::tidy_all_code(x) at test_tidy_code.R:5:4
   2.   └─base::sapply(allcode, tidy_code, width = width, indent = indent)
   3.     └─base::lapply(X = X, FUN = FUN, ...)
   4.       └─iNZightTools (local) FUN(X[[i]], ...)
  ── Error ('test_tidy_code.R:26:5'): Code writing can remove library calls ──────
  Error in `FUN(X[[i]], ...)`: Please install suggested package: 'styler'
  Backtrace:
      ▆
   1. └─iNZightTools::tidy_all_code(x, incl_library = FALSE) at test_tidy_code.R:26:4
   2.   └─base::sapply(allcode, tidy_code, width = width, indent = indent)
   3.     └─base::lapply(X = X, FUN = FUN, ...)
   4.       └─iNZightTools (local) FUN(X[[i]], ...)
  ── Error ('test_tidy_code.R:32:5'): Cody tidying does not break code 2 ─────────
  Error in `FUN(X[[i]], ...)`: Please install suggested package: 'styler'
  Backtrace:
      ▆
   1. └─iNZightTools::tidy_all_code(x) at test_tidy_code.R:32:4
   2.   └─base::sapply(allcode, tidy_code, width = width, indent = indent)
   3.     └─base::lapply(X = X, FUN = FUN, ...)
   4.       └─iNZightTools (local) FUN(X[[i]], ...)
  ── Error ('test_tidy_code.R:53:5'): print_code works OK ────────────────────────
  Error in `FUN(X[[i]], ...)`: Please install suggested package: 'styler'
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test_tidy_code.R:53:4
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─base::eval(parse(text = capture.output(print_code(dat))))
    5. ├─base::parse(text = capture.output(print_code(dat)))
    6. ├─utils::capture.output(print_code(dat))
    7. │ └─base::withVisible(...elt(i))
    8. └─iNZightTools::print_code(dat)
    9.   └─iNZightTools::tidy_all_code(c, ...)
   10.     └─base::sapply(allcode, tidy_code, width = width, indent = indent)
   11.       └─base::lapply(X = X, FUN = FUN, ...)
   12.         └─iNZightTools (local) FUN(X[[i]], ...)
  ── Error ('test_tidy_code.R:66:5'): tidying from file works OK ─────────────────
  Error in `FUN(X[[i]], ...)`: Please install suggested package: 'styler'
  Backtrace:
      ▆
   1. └─iNZightTools::tidy_all_code("messy_gapminder.txt") at test_tidy_code.R:66:4
   2.   └─base::sapply(allcode, tidy_code, width = width, indent = indent)
   3.     └─base::lapply(X = X, FUN = FUN, ...)
   4.       └─iNZightTools (local) FUN(X[[i]], ...)
  ── Error (???): Either united column NAs remain as NAs ─────────────────────────
  <dplyr:::mutate_error/rlang_error/error/condition>
  Error in `dplyr::mutate(., getlunch = forcats::fct_explicit_na(getlunch, 
      "NA"), cellsource = forcats::fct_explicit_na(cellsource, 
      "NA"))`: ℹ In argument: `getlunch = forcats::fct_explicit_na(getlunch, "NA")`.
  Caused by error in `difftime()`:
  ! could not find function "difftime"
  Backtrace:
       ▆
    1. ├─testthat::test_check("iNZightTools")
    2. │ └─testthat::test_dir(...)
    3. │   └─testthat:::test_files(...)
    4. │     └─testthat:::test_files_serial(...)
    5. │       ├─testthat::with_reporter(...)
    6. │       │ └─base::tryCatch(...)
    7. │       │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    8. │       │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    9. │       │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   10. │       └─base::lapply(test_paths, test_one_file, env = env, wrap = wrap)
   11. │         └─testthat (local) FUN(X[[i]], ...)
   12. │           └─testthat::source_file(path, env(env), wrap = wrap)
   13. │             └─testthat:::test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
   14. │               ├─base::tryCatch(...)
   15. │               │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   16. │               │   ├─base (local) tryCatchOne(...)
   17. │               │   │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   18. │               │   └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
   19. │               │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   20. │               │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   21. │               ├─base::withCallingHandlers(...)
   22. │               └─base::eval(code, test_env)
   23. │                 └─base::eval(code, test_env)
   24. │                   └─testthat::test_that(...) at test_unite.R:4:0
   25. │                     └─testthat:::test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
   26. │                       ├─base::tryCatch(...)
   27. │                       │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   28. │                       │   ├─base (local) tryCatchOne(...)
   29. │                       │   │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   30. │                       │   └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
   31. │                       │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   32. │                       │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   33. │                       ├─base::withCallingHandlers(...)
   34. │                       └─base::eval(code, test_env)
   35. │                         └─base::eval(code, test_env)
   36. │                           ├─testthat::expect_equal(...) at test_unite.R:7:4
   37. │                           │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   38. │                           │   └─rlang::eval_bare(expr, quo_get_env(quo))
   39. │                           ├─base::eval(parse(text = code(cas2)))
   40. │                           │ └─base::eval(parse(text = code(cas2)))
   41. │                           └─... %>% dplyr::mutate(new = as.factor(new))
   42. ├─dplyr::mutate(., new = as.factor(new))
   43. ├─tidyr::unite(...)
   44. ├─dplyr::mutate(...)
   45. ├─dplyr:::mutate.data.frame(...)
   46. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
   47. │   ├─base::withCallingHandlers(...)
   48. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
   49. │     └─mask$eval_all_mutate(quo)
   50. │       └─dplyr (local) eval()
   51. ├─forcats::fct_explicit_na(getlunch, "NA")
   52. │ └─lifecycle::deprecate_warn(...)
   53. │   └─lifecycle:::deprecate_warn0(...)
   54. │     └─lifecycle:::needs_warning(id, call = call)
   55. │       └─base::`-.POSIXt`(Sys.time(), last)
   56. └─base::.handleSimpleError(...)
   57.   └─dplyr (local) h(simpleError(msg, call))
   58.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
  ── Error ('test_unite.R:4:1'): (code run outside of `test_that()`) ─────────────
  Error in `options(old_options)`: option 'max.print' cannot be deleted
  Backtrace:
       ▆
    1. └─testthat::test_check("iNZightTools")
    2.   └─testthat::test_dir(...)
    3.     └─testthat:::test_files(...)
    4.       └─testthat:::test_files_serial(...)
    5.         ├─testthat::with_reporter(...)
    6.         │ └─base::tryCatch(...)
    7.         │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    8.         │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    9.         │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   10.         └─base::lapply(test_paths, test_one_file, env = env, wrap = wrap)
   11.           └─testthat (local) FUN(X[[i]], ...)
   12.             └─testthat::source_file(path, env(env), wrap = wrap)
   13.               └─testthat:::test_code(test = NULL, code = exprs, env = env, default_reporter = StopReporter$new())
   14.                 ├─base::tryCatch(...)
   15.                 │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   16.                 │   ├─base (local) tryCatchOne(...)
   17.                 │   │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   18.                 │   └─base (local) tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
   19.                 │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   20.                 │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   21.                 ├─base::withCallingHandlers(...)
   22.                 └─base::eval(code, test_env)
   23.                   └─base::eval(code, test_env)
   24.                     └─testthat::test_that(...) at test_unite.R:4:0
   25.                       └─testthat:::test_code(desc, code, env = parent.frame(), default_reporter = local_interactive_reporter())
   26.                         └─testthat:::testthat_state_condition(before, after, call = sys.call(-1))
   27.                           └─testthat:::waldo_compare(before, after, x_arg = "before", y_arg = "after")
   28.                             └─withr (local) `<fn>`(`<env>`)
  
  [ FAIL 7 | WARN 1295 | SKIP 4 | PASS 352 ]
  Error: Test failures
  In addition: There were 50 or more warnings (use warnings() to see the first 50)
  Execution halted