Running 'testthat.R' [3s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(anomalyDetection)
  > 
  > test_check("anomalyDetection")
  -- 1. Error: hmat produces a ggplot object (@test_hmat.R#4)  -------------------
  Evaluation error: could not find function "n".
  1: expect_is(hmat(security_logs, block_length = 5), "ggplot") at testthat/test_hmat.R:4
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: hmat(security_logs, block_length = 5)
  5: suppressWarnings(suppressMessages(temp <- dplyr::mutate_(tibble::as.tibble(anomalyDetection::mahalanobis_distance(anomalyDetection::mc_adjust(anomalyDetection::tabulate_state_vector(data, 
         block_length, level_limit, level_keep, partial_block, na.rm), min_var, max_cor, 
         action), output, normalize)), .dots = list(Block = quote(as.factor(1:n()))))))
  6: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  7: suppressMessages(temp <- dplyr::mutate_(tibble::as.tibble(anomalyDetection::mahalanobis_distance(anomalyDetection::mc_adjust(anomalyDetection::tabulate_state_vector(data, 
         block_length, level_limit, level_keep, partial_block, na.rm), min_var, max_cor, 
         action), output, normalize)), .dots = list(Block = quote(as.factor(1:n())))))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: dplyr::mutate_(tibble::as.tibble(anomalyDetection::mahalanobis_distance(anomalyDetection::mc_adjust(anomalyDetection::tabulate_state_vector(data, 
         block_length, level_limit, level_keep, partial_block, na.rm), min_var, max_cor, 
         action), output, normalize)), .dots = list(Block = quote(as.factor(1:n()))))
  10: tibble::as.tibble(anomalyDetection::mahalanobis_distance(anomalyDetection::mc_adjust(anomalyDetection::tabulate_state_vector(data, 
         block_length, level_limit, level_keep, partial_block, na.rm), min_var, max_cor, 
         action), output, normalize))
  ...
  14: colnames(data)
  15: is.data.frame(x)
  16: anomalyDetection::tabulate_state_vector(data, block_length, level_limit, level_keep, 
         partial_block, na.rm)
  17: suppressMessages(popvars <- dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars))
  18: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  19: dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars)
  20: tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values")
  21: dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  22: mutate_.tbl_df(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  23: mutate_impl(.data, dots, caller_env())
  
  -- 2. Error: tabulate_state_vector output has correct dimensions (@test_tabulate
  Evaluation error: could not find function "n".
  1: expect_true(tabulate_state_vector(security_logs, 30) %>% is.data.frame()) at testthat/test_tabulate_state_vector.R:5
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: tabulate_state_vector(security_logs, 30) %>% is.data.frame()
  5: eval(lhs, parent, parent)
  6: eval(lhs, parent, parent)
  7: tabulate_state_vector(security_logs, 30)
  8: suppressMessages(popvars <- dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars))
  9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  10: dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars)
  11: tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values")
  12: dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  13: mutate_.tbl_df(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  14: mutate_impl(.data, dots, caller_env())
  
  -- 3. Error: tabulate_state_vector computes correctly (@test_tabulate_state_vect
  Evaluation error: could not find function "n".
  1: expect_equal(tabulate_state_vector(security_logs, 30) %>% .[[1, 1]], 4) at testthat/test_tabulate_state_vector.R:13
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: tabulate_state_vector(security_logs, 30) %>% .[[1, 1]]
  5: eval(lhs, parent, parent)
  6: eval(lhs, parent, parent)
  7: tabulate_state_vector(security_logs, 30)
  8: suppressMessages(popvars <- dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars))
  9: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  10: dplyr::select_(tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values"), ~overflowvars)
  11: tidyr::spread_(dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n()))), 
         "Variables", "Values")
  12: dplyr::mutate_(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  13: mutate_.tbl_df(dplyr::group_by_(dplyr::top_n(dplyr::count_(dplyr::group_by_(dplyr::filter_(stats::na.omit(tidyr::gather_(dplyr::select_(data, 
         ~overflowvars), "Variables", "Values", overflowvars)), .dots = ~substr(Values, 
         1, 1) != "0"), "Variables"), "Values"), level_keep), "Variables"), .dots = list(n = quote(1:n())))
  14: mutate_impl(.data, dots, caller_env())
  
  == testthat results  ===========================================================
  OK: 105 SKIPPED: 3 FAILED: 3
  1. Error: hmat produces a ggplot object (@test_hmat.R#4) 
  2. Error: tabulate_state_vector output has correct dimensions (@test_tabulate_state_vector.R#5) 
  3. Error: tabulate_state_vector computes correctly (@test_tabulate_state_vector.R#13) 
  
  Error: testthat unit tests failed
  Execution halted