Running ‘testthat.R’ [6s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(hutils)
  > 
  > test_check("hutils")
  ── 1. Error: var.weight works as expected (@test_1-0-0_mutate_other.R#127)  ────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: flights_by_dest_month_day %>% mutate_other("dest", var.weight = "N", by = "month") at testthat/test_1-0-0_mutate_other.R:127
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: mutate_other(., "dest", var.weight = "N", by = "month")
  10: out %>% .[, .(`_temp` = .N), keyby = c(var, by)] %>% .[, `:=`(.rank, rank(-`_temp`)), 
         by = by]
  11: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  12: eval(quote(`_fseq`(`_lhs`)), env, env)
  13: eval(quote(`_fseq`(`_lhs`)), env, env)
  14: `_fseq`(`_lhs`)
  15: freduce(value, `_function_list`)
  16: withVisible(function_list[[k]](value))
  17: function_list[[k]](value)
  18: .[, `:=`(.rank, rank(-`_temp`)), by = by]
  19: `[.data.table`(., , `:=`(.rank, rank(-`_temp`)), by = by)
  
  ── 2. Error: Mutate other weighted (@test_1-0-0_mutate_other.R#170)  ───────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: routes_pax %>% mutate_other("dest", by = "origin", other.category = "ZZZ", var.weight = "pax", 
         n = 5) %>% .[origin == "JFK"] at testthat/test_1-0-0_mutate_other.R:170
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: function_list[[i]](value)
  8: mutate_other(., "dest", by = "origin", other.category = "ZZZ", var.weight = "pax", 
         n = 5)
  9: out %>% .[, .N, keyby = c(var, by)] %>% .[, `:=`(.rank, rank(-N)), by = by]
  10: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  11: eval(quote(`_fseq`(`_lhs`)), env, env)
  12: eval(quote(`_fseq`(`_lhs`)), env, env)
  13: `_fseq`(`_lhs`)
  14: freduce(value, `_function_list`)
  15: withVisible(function_list[[k]](value))
  16: function_list[[k]](value)
  17: .[, `:=`(.rank, rank(-N)), by = by]
  18: `[.data.table`(., , `:=`(.rank, rank(-N)), by = by)
  
  ── 3. Error: Mutate other weighted with mass (@test_1-0-0_mutate_other.R#206)  ─
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: routes_pax %>% mutate_other("dest", other.category = "ZZZ", by = "origin", var.weight = "pax", 
         n = NULL, mass = 1e+05) %>% .[] at testthat/test_1-0-0_mutate_other.R:206
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: function_list[[i]](value)
  8: mutate_other(., "dest", other.category = "ZZZ", by = "origin", var.weight = "pax", 
         n = NULL, mass = 1e+05)
  9: out %>% .[, .N, keyby = c(var, by)] %>% .[, `:=`(.rank, rank(-N)), by = by]
  10: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  11: eval(quote(`_fseq`(`_lhs`)), env, env)
  12: eval(quote(`_fseq`(`_lhs`)), env, env)
  13: `_fseq`(`_lhs`)
  14: freduce(value, `_function_list`)
  15: withVisible(function_list[[k]](value))
  16: function_list[[k]](value)
  17: .[, `:=`(.rank, rank(-N)), by = by]
  18: `[.data.table`(., , `:=`(.rank, rank(-N)), by = by)
  
  ── 4. Error: Corner cases (@test_1-0-0_mutate_other.R#228)  ────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: mutate_other(flights2, "dest") at testthat/test_1-0-0_mutate_other.R:228
  2: out %>% .[, stats::setNames(list(`_temp` = .N), nm = new_nom), keyby = c(var, by)] %>% 
         setorderv(c(by, new_nom)) %>% .[, `:=`(.rank, seq_len(.N)), by = by]
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: function_list[[i]](value)
  9: .[, stats::setNames(list(`_temp` = .N), nm = new_nom), keyby = c(var, by)]
  10: `[.data.table`(., , stats::setNames(list(`_temp` = .N), nm = new_nom), keyby = c(var, 
         by))
  
  ── 5. Error: Example works (@test_1-0-0_weight2var.R#6)  ───────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: weight2rows(DT, "y") at testthat/test_1-0-0_weight2var.R:6
  2: DT %>% .[weight.var.value > 0] %>% .[, lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != 
         weight.var], by = weight.var]
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: withVisible(function_list[[k]](value))
  9: function_list[[k]](value)
  10: .[, lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != weight.var], 
         by = weight.var]
  11: `[.data.table`(., , lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != 
         weight.var], by = weight.var)
  
  ── 6. Error: Data frame (@test_1-0-0_weight2var.R#27)  ─────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: weight2rows(DT, "y") at testthat/test_1-0-0_weight2var.R:27
  2: DT %>% .[weight.var.value > 0] %>% .[, lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != 
         weight.var], by = weight.var]
  3: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: `_fseq`(`_lhs`)
  7: freduce(value, `_function_list`)
  8: withVisible(function_list[[k]](value))
  9: function_list[[k]](value)
  10: .[, lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != weight.var], 
         by = weight.var]
  11: `[.data.table`(., , lapply(.SD, rep_len, .BY[[1]] * .N), .SDcols = names(.)[names(.) != 
         weight.var], by = weight.var)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 252 SKIPPED: 7 FAILED: 6
  1. Error: var.weight works as expected (@test_1-0-0_mutate_other.R#127) 
  2. Error: Mutate other weighted (@test_1-0-0_mutate_other.R#170) 
  3. Error: Mutate other weighted with mass (@test_1-0-0_mutate_other.R#206) 
  4. Error: Corner cases (@test_1-0-0_mutate_other.R#228) 
  5. Error: Example works (@test_1-0-0_weight2var.R#6) 
  6. Error: Data frame (@test_1-0-0_weight2var.R#27) 
  
  Error: testthat unit tests failed
  Execution halted