Running ‘testthat.R’ [4s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(anomalize)
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > library(ggplot2)
  > library(tibble)
  > 
  > # set_time_scale_template(time_scale_template())
  > 
  > test_check("anomalize")
  ── 1. Error: iqr_grouped_df works (@test-anomalize.R#32)  ──────────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% dplyr::ungroup() %>% dplyr::filter(package %in% c("tidyquant", 
         "tidytext")) %>% dplyr::group_by(package) %>% anomalize(count, method = "iqr") at testthat/test-anomalize.R:32
  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: anomalize(., count, method = "iqr")
  10: anomalize.grouped_df(., count, method = "iqr")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 2. Error: gesd_grouped_df works (@test-anomalize.R#45)  ─────────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% dplyr::ungroup() %>% dplyr::filter(package %in% c("tidyquant", 
         "tidytext")) %>% dplyr::group_by(package) %>% anomalize(count, method = "gesd") at testthat/test-anomalize.R:45
  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: anomalize(., count, method = "gesd")
  10: anomalize.grouped_df(., count, method = "gesd")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 3. Error: returns a ggplot (@test-plot_anomalies.R#8)  ──────────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "stl") %>% anomalize(remainder, 
         method = "iqr") %>% time_recompose() %>% plot_anomalies(time_recomposed = TRUE, 
         ncol = 3) at testthat/test-plot_anomalies.R:8
  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: time_decompose(., count, method = "stl")
  9: time_decompose.grouped_tbl_time(., count, method = "stl")
  10: data %>% grouped_mapper(.f = time_decompose, target = !!target_expr, method = method[[1]], 
         frequency = frequency, trend = trend, ... = ..., merge = merge, message = message)
  ...
  22: eval(quote(`_fseq`(`_lhs`)), env, env)
  23: `_fseq`(`_lhs`)
  24: freduce(value, `_function_list`)
  25: function_list[[i]](value)
  26: tidyr::nest(.)
  27: nest.tbl_time(.)
  28: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  29: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  30: check_key(.key)
  31: is_missing(.key)
  
  ── 4. Error: grouped_tbl_time works (@test-time_apply.R#11)  ───────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_apply(count, period = "1 week", .fun = mean, na.rm = TRUE) at testthat/test-time_apply.R:11
  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: time_apply(., count, period = "1 week", .fun = mean, na.rm = TRUE)
  10: time_apply.grouped_df(., count, period = "1 week", .fun = mean, na.rm = TRUE)
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 5. Error: grouped tbl_df (@test-time_decompose.R#26)  ───────────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% as.tibble() %>% time_decompose(count, method = "stl", 
         frequency = "auto", trend = "auto") at testthat/test-time_decompose.R:26
  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: time_decompose(., count, method = "stl", frequency = "auto", trend = "auto")
  10: time_decompose.grouped_df(., count, method = "stl", frequency = "auto", trend = "auto")
  ...
  25: eval(quote(`_fseq`(`_lhs`)), env, env)
  26: `_fseq`(`_lhs`)
  27: freduce(value, `_function_list`)
  28: function_list[[i]](value)
  29: tidyr::nest(.)
  30: nest.tbl_time(.)
  31: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  32: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  33: check_key(.key)
  34: is_missing(.key)
  
  ── 6. Error: method = stl, auto freq/trend (@test-time_decompose.R#36)  ────────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "stl", frequency = "auto", 
         trend = "auto") at testthat/test-time_decompose.R:36
  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: time_decompose(., count, method = "stl", frequency = "auto", trend = "auto")
  10: time_decompose.grouped_tbl_time(., count, method = "stl", frequency = "auto", trend = "auto")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 7. Error: method = stl, character freq/trend (@test-time_decompose.R#46)  ───
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "stl", frequency = "1 month", 
         trend = "3 months") at testthat/test-time_decompose.R:46
  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: time_decompose(., count, method = "stl", frequency = "1 month", trend = "3 months")
  10: time_decompose.grouped_tbl_time(., count, method = "stl", frequency = "1 month", 
         trend = "3 months")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 8. Error: method = stl, numeric freq/trend (@test-time_decompose.R#56)  ─────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "stl", frequency = 7, 
         trend = 30) at testthat/test-time_decompose.R:56
  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: time_decompose(., count, method = "stl", frequency = 7, trend = 30)
  10: time_decompose.grouped_tbl_time(., count, method = "stl", frequency = 7, trend = 30)
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 9. Error: method = twitter, auto freq/trend (@test-time_decompose.R#66)  ────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "twitter", frequency = "auto", 
         trend = "auto") at testthat/test-time_decompose.R:66
  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: time_decompose(., count, method = "twitter", frequency = "auto", trend = "auto")
  10: time_decompose.grouped_tbl_time(., count, method = "twitter", frequency = "auto", 
         trend = "auto")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 10. Error: method = twitter, character freq/trend (@test-time_decompose.R#76)
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "twitter", frequency = "1 week", 
         trend = "1 month") at testthat/test-time_decompose.R:76
  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: time_decompose(., count, method = "twitter", frequency = "1 week", trend = "1 month")
  10: time_decompose.grouped_tbl_time(., count, method = "twitter", frequency = "1 week", 
         trend = "1 month")
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 11. Error: method = twitter, numeric freq/trend (@test-time_decompose.R#86)  
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "twitter", frequency = 7, 
         trend = 90) at testthat/test-time_decompose.R:86
  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: time_decompose(., count, method = "twitter", frequency = 7, trend = 90)
  10: time_decompose.grouped_tbl_time(., count, method = "twitter", frequency = 7, trend = 90)
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ── 12. Error: grouped_df works (@test-time_decompose.R#126)  ───────────────────
  invalid argument type
  1: tidyverse_cran_downloads %>% as.tibble() %>% time_decompose(count) at testthat/test-time_decompose.R:126
  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: time_decompose(., count)
  10: time_decompose.grouped_df(., count)
  ...
  25: eval(quote(`_fseq`(`_lhs`)), env, env)
  26: `_fseq`(`_lhs`)
  27: freduce(value, `_function_list`)
  28: function_list[[i]](value)
  29: tidyr::nest(.)
  30: nest.tbl_time(.)
  31: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  32: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  33: check_key(.key)
  34: is_missing(.key)
  
  ── 13. Error: time_recompose works on grouped_tbl_time (@test-time_recompose.R#9
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, method = "stl") %>% anomalize(remainder, 
         method = "iqr") %>% time_recompose() at testthat/test-time_recompose.R:9
  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: time_decompose(., count, method = "stl")
  9: time_decompose.grouped_tbl_time(., count, method = "stl")
  10: data %>% grouped_mapper(.f = time_decompose, target = !!target_expr, method = method[[1]], 
         frequency = frequency, trend = trend, ... = ..., merge = merge, message = message)
  ...
  22: eval(quote(`_fseq`(`_lhs`)), env, env)
  23: `_fseq`(`_lhs`)
  24: freduce(value, `_function_list`)
  25: function_list[[i]](value)
  26: tidyr::nest(.)
  27: nest.tbl_time(.)
  28: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  29: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  30: check_key(.key)
  31: is_missing(.key)
  
  ── 14. Error: utils: time_decompose `merge = T` works (@test-utils.R#4)  ───────
  invalid argument type
  1: tidyverse_cran_downloads %>% time_decompose(count, merge = T) at testthat/test-utils.R:4
  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: time_decompose(., count, merge = T)
  10: time_decompose.grouped_tbl_time(., count, merge = T)
  ...
  23: eval(quote(`_fseq`(`_lhs`)), env, env)
  24: `_fseq`(`_lhs`)
  25: freduce(value, `_function_list`)
  26: function_list[[i]](value)
  27: tidyr::nest(.)
  28: nest.tbl_time(.)
  29: tidyr::nest(as_tibble(data), ..., .key = !!.key)
  30: nest.grouped_df(as_tibble(data), ..., .key = !!.key)
  31: check_key(.key)
  32: is_missing(.key)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 33 | SKIPPED: 0 | WARNINGS: 1 | FAILED: 14 ]
  1. Error: iqr_grouped_df works (@test-anomalize.R#32) 
  2. Error: gesd_grouped_df works (@test-anomalize.R#45) 
  3. Error: returns a ggplot (@test-plot_anomalies.R#8) 
  4. Error: grouped_tbl_time works (@test-time_apply.R#11) 
  5. Error: grouped tbl_df (@test-time_decompose.R#26) 
  6. Error: method = stl, auto freq/trend (@test-time_decompose.R#36) 
  7. Error: method = stl, character freq/trend (@test-time_decompose.R#46) 
  8. Error: method = stl, numeric freq/trend (@test-time_decompose.R#56) 
  9. Error: method = twitter, auto freq/trend (@test-time_decompose.R#66) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted