Running 'testthat.R' [2s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(mdsstat)
  > 
  > test_check("mdsstat")
  -- 1. Failure: df parameter functions as expected (@test_addtl.R#72)  ----------
  a2$status isn't true.
  
  -- 2. Error: df parameter functions as expected (@test_addtl.R#79)  ------------
  $ operator is invalid for atomic vectors
  1: expect_true(a2$result$statistic > 0) at testthat/test_addtl.R:79
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 3. Failure: p_rate parameter functions as expected (@test_addtl.R#137)  -----
  `poisson_rare(mds_ts[[1]], p_rate = -1)` did not throw an error.
  
  -- 4. Failure: p_rate parameter functions as expected (@test_addtl.R#138)  -----
  `poisson_rare(mds_ts[[1]], p_rate = -0.1)` did not throw an error.
  
  -- 5. Failure: df parameter functions as expected (@test_cusum.R#84)  ----------
  a2$status isn't true.
  
  -- 6. Error: df parameter functions as expected (@test_cusum.R#94)  ------------
  $ operator is invalid for atomic vectors
  1: expect_true(all(a2$result$statistic >= 0)) at testthat/test_cusum.R:94
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 7. Failure: test errors on missing 2x2 cells (@test_prr.R#114)  -------------
  `prr(mds_ts[[1]])` did not throw an error.
  
  -- 8. Failure: test does not run on 0 cell counts (@test_prr.R#118)  -----------
  !prr(mds_ts[[2]], eval_period = 6L)$status isn't true.
  
  -- 9. Failure: PRR df parameter functions as expected (@test_prr.R#137)  -------
  a2$status isn't true.
  
  -- 10. Error: PRR df parameter functions as expected (@test_prr.R#145)  --------
  $ operator is invalid for atomic vectors
  1: expect_true(abs(a2$result$statistic) > 0) at testthat/test_prr.R:145
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 11. Error: ts_event parameter functions as expected (@test_prr.R#173)  ------
  $ operator is invalid for atomic vectors
  1: expect_equal(a3$result$statistic, prr(a3d)$result$statistic) at testthat/test_prr.R:173
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 12. Failure: eval_period parameter functions as expected (@test_prr.R#184)  -
  a3$data$data[, -c(1:2)] not equal to data.frame(...).
  Component "nA": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nB": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nC": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nD": 'is.NA' value mismatch: 1 in current 0 in target
  
  -- 13. Error: alpha parameter functions as expected (@test_prr.R#210)  ---------
  $ operator is invalid for atomic vectors
  1: expect_equal(as.numeric(a3$result$signal_threshold), 0.01) at testthat/test_prr.R:210
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 14. Failure: test errors on missing 2x2 cells (@test_ror.R#114)  ------------
  `ror(mds_ts[[1]])` did not throw an error.
  
  -- 15. Failure: test does not run on 0 cell counts (@test_ror.R#118)  ----------
  !ror(mds_ts[[2]], eval_period = 6L)$status isn't true.
  
  -- 16. Failure: ROR df parameter functions as expected (@test_ror.R#138)  ------
  a3$status isn't true.
  
  -- 17. Error: ROR df parameter functions as expected (@test_ror.R#146)  --------
  $ operator is invalid for atomic vectors
  1: expect_true(abs(a3$result$statistic) > 0) at testthat/test_ror.R:146
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 18. Error: ts_event parameter functions as expected (@test_ror.R#175)  ------
  $ operator is invalid for atomic vectors
  1: expect_equal(a4$result$statistic, ror(a3d)$result$statistic) at testthat/test_ror.R:175
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 19. Failure: eval_period parameter functions as expected (@test_ror.R#186)  -
  a4$data$data[, -c(1:2)] not equal to data.frame(...).
  Component "nA": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nB": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nC": 'is.NA' value mismatch: 1 in current 0 in target
  Component "nD": 'is.NA' value mismatch: 1 in current 0 in target
  
  -- 20. Error: alpha parameter functions as expected (@test_ror.R#212)  ---------
  $ operator is invalid for atomic vectors
  1: expect_equal(as.numeric(a4$result$signal_threshold), 0.01) at testthat/test_ror.R:212
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 21. Failure: df parameter functions as expected (@test_shewhart.R#78)  ------
  a2$status isn't true.
  
  -- 22. Error: df parameter functions as expected (@test_shewhart.R#87)  --------
  $ operator is invalid for atomic vectors
  1: expect_true(abs(a2$result$statistic) > 0) at testthat/test_shewhart.R:87
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 23. Error: we_rule 2 functions as expected (@test_shewhart.R#153)  ----------
  $ operator is invalid for atomic vectors
  1: expect_equal(length(a22L$result$statistic), 3) at testthat/test_shewhart.R:153
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 24. Error: we_rule 3 functions as expected (@test_shewhart.R#160)  ----------
  $ operator is invalid for atomic vectors
  1: expect_equal(length(a23L$result$statistic), 5) at testthat/test_shewhart.R:160
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 25. Failure: outputs are as expected (@test_stats.R#34)  --------------------
  a1$run_status isn't true.
  
  -- 26. Failure: only legal inputs are allowed (@test_stats.R#40)  --------------
  a1$run_status isn't true.
  
  -- 27. Error: (unknown) (@test_stats.R#70)  ------------------------------------
  missing value where TRUE/FALSE needed
  1: run_algos(data, a2) at testthat/test_stats.R:70
  2: run_algos.default(data, a2)
  3: do.call(algo, c(list(df = data), algos[[i]]))
  4: (function (df, ...) 
     {
         UseMethod("shewhart", df)
     })(df = structure(list(time = structure(c(17167, 17198, 17226, 17257, 17287, 17318, 
     17348, 17379, 17410, 17440, 17471, 17501), class = c("mds_Date", "Date")), nA = c(NA, 
     NA, NA, 1L, NA, NA, NA, NA, NA, NA, NA, NA), nC = c(NA, NA, NA, 0L, NA, NA, NA, NA, 
     NA, NA, NA, NA), nB = c(NA, NA, NA, 0L, NA, NA, NA, NA, NA, NA, NA, NA), nD = c(NA, 
     NA, NA, 0L, NA, NA, NA, NA, NA, NA, NA, NA), ids = list(NULL, NULL, NULL, "0001822565-2017-02374", 
         NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), exposure = c(233, 166, 272, 
     216, 225, 138, 257, 170, 195, 186, 255, 185), ids_exposure = list("181", "182", "183", 
         "184", "185", "186", "187", "188", "189", "190", "191", "192"), rate = c(NA, 
     NA, NA, 0.00462962962962963, NA, NA, NA, NA, NA, NA, NA, NA)), row.names = c(NA, 
     12L), title = "region by device_name WITHIN device_class 1", analysis = structure(list(
         device_level_source = "device_name", device_level = structure(c(device_1 = 6L), .Label = c("Arthroscope", 
         "Bone Cement", "Bone Cement, Antibiotic", "Cement, Bone, Vertebroplasty", "Filler, Bone Void, Calcium Compound", 
         "Mixer, Cement, For Clinical Use", "Orthopedic Stereotaxic Instrument", "Prosthesis, Knee, Patello/Femorotibial, Semi-Constrained, Uncemented, Porous, Coated, Polymer/Metal/Polymer", 
         "Prosthesis, Knee, Patellofemorotibial, Semi-Constrained, Cemented, Polymer/Metal/Polymer", 
         "Prosthesis, Shoulder, Hemi-, Humeral, Metallic Uncemented"), class = "factor"), 
         device_1up_source = "device_class", device_1up = c(device_2 = "1"), event_level_source = "event_type", 
         event_level = c(event_1 = "All"), event_1up_source = NA_character_, event_1up = structure(NA, .Names = NA_character_), 
         covariate = "region", covariate_level = "Central", date_range_de = structure(c(start = 17257, 
         end = 17257), class = c("mds_Date", "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, 
             n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         }), exp_device_level = c(device_1 = "Mixer, Cement, For Clinical Use"), exp_device_1up = structure(NA, .Names = NA_character_), 
         exp_covariate_level = c(region = "Central"), date_range_exposure = structure(c(start = 17167, 
         end = 17501), class = c("mds_Date", "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, 
             n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         }), date_range_de_exp = structure(c(start = 17257, end = 17257), class = c("mds_Date", 
         "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         })), class = c("list", "mds_da")), exposure = TRUE, dpa = TRUE, dpa_detail = list(
         nA = "region Central:device_name Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nB = "region Central:device_name NOT Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nC = "region NOT Central:device_name Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nD = "region NOT Central:device_name NOT Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nRow = "region", nCol = "device_name WITHIN device_class 1", nABCD = "region by device_name WITHIN device_class 1"), class = c("mds_ts", 
     "data.frame")), ts_event = c(Rate = "rate"), we_rule = 2L)
  5: shewhart.mds_ts(df = structure(list(time = structure(c(17167, 17198, 17226, 17257, 
     17287, 17318, 17348, 17379, 17410, 17440, 17471, 17501), class = c("mds_Date", "Date"
     )), nA = c(NA, NA, NA, 1L, NA, NA, NA, NA, NA, NA, NA, NA), nC = c(NA, NA, NA, 0L, 
     NA, NA, NA, NA, NA, NA, NA, NA), nB = c(NA, NA, NA, 0L, NA, NA, NA, NA, NA, NA, NA, 
     NA), nD = c(NA, NA, NA, 0L, NA, NA, NA, NA, NA, NA, NA, NA), ids = list(NULL, NULL, 
         NULL, "0001822565-2017-02374", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), 
         exposure = c(233, 166, 272, 216, 225, 138, 257, 170, 195, 186, 255, 185), ids_exposure = list(
             "181", "182", "183", "184", "185", "186", "187", "188", "189", "190", "191", 
             "192"), rate = c(NA, NA, NA, 0.00462962962962963, NA, NA, NA, NA, NA, NA, 
         NA, NA)), row.names = c(NA, 12L), title = "region by device_name WITHIN device_class 1", analysis = structure(list(
         device_level_source = "device_name", device_level = structure(c(device_1 = 6L), .Label = c("Arthroscope", 
         "Bone Cement", "Bone Cement, Antibiotic", "Cement, Bone, Vertebroplasty", "Filler, Bone Void, Calcium Compound", 
         "Mixer, Cement, For Clinical Use", "Orthopedic Stereotaxic Instrument", "Prosthesis, Knee, Patello/Femorotibial, Semi-Constrained, Uncemented, Porous, Coated, Polymer/Metal/Polymer", 
         "Prosthesis, Knee, Patellofemorotibial, Semi-Constrained, Cemented, Polymer/Metal/Polymer", 
         "Prosthesis, Shoulder, Hemi-, Humeral, Metallic Uncemented"), class = "factor"), 
         device_1up_source = "device_class", device_1up = c(device_2 = "1"), event_level_source = "event_type", 
         event_level = c(event_1 = "All"), event_1up_source = NA_character_, event_1up = structure(NA, .Names = NA_character_), 
         covariate = "region", covariate_level = "Central", date_range_de = structure(c(start = 17257, 
         end = 17257), class = c("mds_Date", "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, 
             n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         }), exp_device_level = c(device_1 = "Mixer, Cement, For Clinical Use"), exp_device_1up = structure(NA, .Names = NA_character_), 
         exp_covariate_level = c(region = "Central"), date_range_exposure = structure(c(start = 17167, 
         end = 17501), class = c("mds_Date", "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, 
             n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         }), date_range_de_exp = structure(c(start = 17257, end = 17257), class = c("mds_Date", 
         "Date"), convert_to_n = 1, convert_type = "months", adder = function (t, n) 
         {
             lubridate::add_with_rollback(lubridate::ymd(t), months(convert_to_n * n))
         })), class = c("list", "mds_da")), exposure = TRUE, dpa = TRUE, dpa_detail = list(
         nA = "region Central:device_name Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nB = "region Central:device_name NOT Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nC = "region NOT Central:device_name Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nD = "region NOT Central:device_name NOT Mixer, Cement, For Clinical Use WITHIN device_class 1", 
         nRow = "region", nCol = "device_name WITHIN device_class 1", nABCD = "region by device_name WITHIN device_class 1"), class = c("mds_ts", 
     "data.frame")), ts_event = c(Rate = "rate"), we_rule = 2L)
  6: shewhart.default(out, analysis_of = name, ...)
  
  == testthat results  ===========================================================
  OK: 268 SKIPPED: 0 FAILED: 27
  1. Failure: df parameter functions as expected (@test_addtl.R#72) 
  2. Error: df parameter functions as expected (@test_addtl.R#79) 
  3. Failure: p_rate parameter functions as expected (@test_addtl.R#137) 
  4. Failure: p_rate parameter functions as expected (@test_addtl.R#138) 
  5. Failure: df parameter functions as expected (@test_cusum.R#84) 
  6. Error: df parameter functions as expected (@test_cusum.R#94) 
  7. Failure: test errors on missing 2x2 cells (@test_prr.R#114) 
  8. Failure: test does not run on 0 cell counts (@test_prr.R#118) 
  9. Failure: PRR df parameter functions as expected (@test_prr.R#137) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted