Running ‘test-all.R’ [35s/50s]
  Running ‘test-build-data.R’ [1s/1s]
  Running ‘test-deprecated.R’ [1s/1s]
  Running ‘test-slow.R’ [1s/1s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > # Copyright (C) 2014 - 2018  Jack O. Wasey
  > #
  > # This file is part of icd.
  > #
  > # icd is free software: you can redistribute it and/or modify
  > # it under the terms of the GNU General Public License as published by
  > # the Free Software Foundation, either version 3 of the License, or
  > # (at your option) any later version.
  > #
  > # icd is distributed in the hope that it will be useful,
  > # but WITHOUT ANY WARRANTY; without even the implied warranty of
  > # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  > # GNU General Public License for more details.
  > #
  > # You should have received a copy of the GNU General Public License
  > # along with icd. If not, see <http:#www.gnu.org/licenses/>.
  > 
  > # this is common code to all the tests, each of which runs test_check with a different filter:
  > library("icd")
  Loading required package: icd.data
  > library("icd.data")
  > library("testthat", warn.conflicts = FALSE, quietly = TRUE)
  > library("magrittr", warn.conflicts = FALSE, quietly = TRUE)
  > if (!tolower(Sys.getenv("ICD_TEST_ALL")) %in% c("no", "false"))
  +   testthat::test_check("icd")
  loading helper-base.R
  loading helper-icd10.R
  ── 1. Error: simplest test case for a NA in codes with matching code (@test-como
  replacement has 1 row, data has 0
  1: icd10_comorbid_ahrq(d, return_df = TRUE) at testthat/test-comorbid-calcs-icd10.R:46
  2: apply_hier_ahrq(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 2. Error: failing example (@test-comorbid-calcs-icd9.R#50)  ─────────────────
  replacement has 1 row, data has 0
  1: charlson(mydf, short_code = FALSE) at testthat/test-comorbid-calcs-icd9.R:50
  2: charlson.data.frame(mydf, short_code = FALSE)
  3: charlson_from_comorbid(comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, 
         return_df = TRUE, ...), visit_name = visit_name, hierarchy = FALSE, scoring_system = scoring_system)
  4: assert(check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named"), check_matrix(x, 
         min.rows = 0, min.cols = 2, col.names = "named"))
  5: eval(dots[[i]], envir = env)
  6: eval(dots[[i]], envir = env)
  7: check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named")
  8: .Call(c_check_dataframe, x, any.missing, all.missing, min.rows, min.cols, nrows, 
         ncols, row.names, col.names, null.ok) %and% checkListTypes(x, types)
  9: comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, return_df = TRUE, 
         ...)
  10: switch_ver_cmb(x, list(icd9 = icd9_comorbid_quan_deyo, icd10 = icd10_comorbid_quan_deyo), 
         ...)
  11: funs[["icd9"]](x, ...)
  12: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  13: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  14: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 3. Error: Charlson/Deyo comorbidities for a single patient, one icd9 (@test-c
  replacement has 1 row, data has 0
  1: expect_equal(icd9_comorbid_quan_deyo(one_pt_one_icd9, short_code = FALSE, return_df = TRUE), 
         structure(list(visit_id = "a", MI = FALSE, CHF = FALSE, PVD = FALSE, Stroke = FALSE, 
             Dementia = FALSE, Pulmonary = FALSE, Rheumatic = FALSE, PUD = FALSE, LiverMild = FALSE, 
             DM = FALSE, DMcx = FALSE, Paralysis = FALSE, Renal = FALSE, Cancer = FALSE, 
             LiverSevere = FALSE, Mets = FALSE, HIV = TRUE), .Names = c("visit_id", "MI", 
             "CHF", "PVD", "Stroke", "Dementia", "Pulmonary", "Rheumatic", "PUD", "LiverMild", 
             "DM", "DMcx", "Paralysis", "Renal", "Cancer", "LiverSevere", "Mets", "HIV"), 
             row.names = 1L, class = "data.frame")) at testthat/test-comorbid-calcs-icd9.R:352
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: icd9_comorbid_quan_deyo(one_pt_one_icd9, short_code = FALSE, return_df = TRUE)
  5: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  6: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  7: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  8: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 4. Failure: no error for deyo single pt w two identical (major) icd9 codes (@
  `icd9_comorbid_quan_deyo(...)` threw an error.
  Message: replacement has 1 row, data has 0
  Class:   simpleError/error/condition
  
  ── 5. Failure: no error for deyo single pt w two different decimal icd9 codes (@
  `icd9_comorbid_quan_deyo(mydf, short_code = FALSE, return_df = TRUE)` threw an error.
  Message: replacement has 1 row, data has 0
  Class:   simpleError/error/condition
  
  ── 6. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/c
  replacement has 1 row, data has 0
  1: charlson(mydf)
  2: charlson.data.frame(mydf)
  3: charlson_from_comorbid(comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, 
         return_df = TRUE, ...), visit_name = visit_name, hierarchy = FALSE, scoring_system = scoring_system)
  4: assert(check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named"), check_matrix(x, 
         min.rows = 0, min.cols = 2, col.names = "named"))
  5: eval(dots[[i]], envir = env)
  6: eval(dots[[i]], envir = env)
  7: check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named")
  8: .Call(c_check_dataframe, x, any.missing, all.missing, min.rows, min.cols, nrows, 
         ncols, row.names, col.names, null.ok) %and% checkListTypes(x, types)
  9: comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, return_df = TRUE, 
         ...)
  10: switch_ver_cmb(x, list(icd9 = icd9_comorbid_quan_deyo, icd10 = icd10_comorbid_quan_deyo), 
         ...)
  11: funs[["icd9"]](x, ...)
  12: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  13: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  14: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  15: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 7. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/c
  replacement has 1 row, data has 0
  1: icd9_comorbid_elix(longdf, return_df = TRUE)
  2: apply_hier_elix(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, x[, which(colnames(x) == "Mets")] > 0, "Tumor", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, x[, which(colnames(x) == "Mets")] > 0, "Tumor", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 8. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/c
  replacement has 1 row, data has 0
  1: icd9_comorbid_quan_deyo(mydf, short_code = FALSE, return_df = TRUE)
  2: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 9. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/v
  replacement has 1 row, data has 0
  1: van_walraven(mydf)
  2: van_walraven.data.frame(mydf)
  3: icd9_comorbid_quan_elix(x, visit_name, hierarchy = TRUE, return_df = TRUE, ...)
  4: apply_hier_quan_elix(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  5: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  6: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 10. Error: dataframe to matrix and back (@test-reshape.R#71)  ───────────────
  replacement has 1 row, data has 0
  1: comorbid_ahrq(pts, return_df = TRUE) at testthat/test-reshape.R:71
  2: switch_ver_cmb(x, list(icd9 = icd9_comorbid_ahrq, icd10 = icd10_comorbid_ahrq), ...)
  3: funs[["icd9"]](x, ...)
  4: apply_hier_ahrq(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  5: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  6: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 11. Error: github issue #44 from wmurphyrd (@test-score.R#24)  ──────────────
  replacement has 1 row, data has 0
  1: expect_warning(res <- charlson(mydf, return_df = TRUE), NA) at testthat/test-score.R:24
  2: quasi_capture(enquo(object), capture_warnings, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: charlson(mydf, return_df = TRUE)
  7: charlson.data.frame(mydf, return_df = TRUE)
  8: charlson_from_comorbid(comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, 
         return_df = TRUE, ...), visit_name = visit_name, hierarchy = FALSE, scoring_system = scoring_system)
  9: assert(check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named"), check_matrix(x, 
         min.rows = 0, min.cols = 2, col.names = "named"))
  10: eval(dots[[i]], envir = env)
  11: eval(dots[[i]], envir = env)
  12: check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named")
  13: .Call(c_check_dataframe, x, any.missing, all.missing, min.rows, min.cols, nrows, 
         ncols, row.names, col.names, null.ok) %and% checkListTypes(x, types)
  14: comorbid_quan_deyo(x, visit_name = visit_name, hierarchy = TRUE, return_df = TRUE, 
         ...)
  15: switch_ver_cmb(x, list(icd9 = icd9_comorbid_quan_deyo, icd10 = icd10_comorbid_quan_deyo), 
         ...)
  16: funs[["icd9"]](x, ...)
  17: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  18: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  19: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  20: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 12. Error: github issue #46 from wmurphyd (@test-score.R#30)  ───────────────
  replacement has 1 row, data has 0
  1: icd9_comorbid_quan_deyo(mydf, short_code = FALSE, return_df = TRUE) at testthat/test-score.R:30
  2: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 13. Error: Charlson score (@test-score.R#62)  ───────────────────────────────
  replacement has 1 row, data has 0
  1: expect_equal(charlson_from_comorbid(icd9_comorbid_quan_deyo(mydf, short_code = FALSE, 
         hierarchy = TRUE, return_df = TRUE)), charlson(mydf, short_code = FALSE, return_df = FALSE)) at testthat/test-score.R:62
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: charlson_from_comorbid(icd9_comorbid_quan_deyo(mydf, short_code = FALSE, hierarchy = TRUE, 
         return_df = TRUE))
  5: assert(check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named"), check_matrix(x, 
         min.rows = 0, min.cols = 2, col.names = "named"))
  6: eval(dots[[i]], envir = env)
  7: eval(dots[[i]], envir = env)
  8: check_data_frame(x, min.rows = 0, min.cols = 2, col.names = "named")
  9: .Call(c_check_dataframe, x, any.missing, all.missing, min.rows, min.cols, nrows, 
         ncols, row.names, col.names, null.ok) %and% checkListTypes(x, types)
  10: icd9_comorbid_quan_deyo(mydf, short_code = FALSE, hierarchy = TRUE, return_df = TRUE)
  11: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  12: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  13: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  14: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 14. Error: count icd9 codes (@test-score.R#151)  ────────────────────────────
  replacement has 1 row, data has 0
  1: icd9_comorbid_quan_deyo(mydf, short_code = FALSE, return_df = TRUE) at testthat/test-score.R:151
  2: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 15. Error: van_walraven_from_comorbid score calculation (@test-score.R#207)  
  replacement has 1 row, data has 0
  1: icd9_comorbid_quan_elix(mydf <- data.frame(visit_id = "a", icd9 = "250.0"), return_df = TRUE) at testthat/test-score.R:207
  2: apply_hier_quan_elix(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  3: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  4: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  5: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 16. Error: van_walraven comodbidity index and score (@test-score.R#241)  ────
  replacement has 1 row, data has 0
  1: expect_equivalent(van_walraven(mydf, visit_name = "id", icd_name = "value"), van_walraven_from_comorbid(icd9_comorbid_quan_elix(mydf, 
         visit_name = "id", icd_name = "value"))) at testthat/test-score.R:241
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: van_walraven(mydf, visit_name = "id", icd_name = "value")
  5: van_walraven.data.frame(mydf, visit_name = "id", icd_name = "value")
  6: icd9_comorbid_quan_elix(x, visit_name, hierarchy = TRUE, return_df = TRUE, ...)
  7: apply_hier_quan_elix(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  8: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  9: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Tumor", value = FALSE)
  10: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ── 17. Error: github issue #64 - quan revised charleson scores (@test-score.R#25
  replacement has 1 row, data has 0
  1: comorbid_quan_deyo(mydf, short_code = FALSE, return_df = TRUE) at testthat/test-score.R:257
  2: switch_ver_cmb(x, list(icd9 = icd9_comorbid_quan_deyo, icd10 = icd10_comorbid_quan_deyo), 
         ...)
  3: funs[["icd9"]](x, ...)
  4: apply_hier_quan_deyo(cbd, abbrev_names = abbrev_names, hierarchy = hierarchy)
  5: `[<-`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  6: `[<-.data.frame`(`*tmp*`, cbd[, "Mets"] > 0, "Cancer", value = FALSE)
  7: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, n), domain = NA)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 5441 SKIPPED: 36 FAILED: 17
  1. Error: simplest test case for a NA in codes with matching code (@test-comorbid-calcs-icd10.R#46) 
  2. Error: failing example (@test-comorbid-calcs-icd9.R#50) 
  3. Error: Charlson/Deyo comorbidities for a single patient, one icd9 (@test-comorbid-calcs-icd9.R#352) 
  4. Failure: no error for deyo single pt w two identical (major) icd9 codes (@test-comorbid-calcs-icd9.R#370) 
  5. Failure: no error for deyo single pt w two different decimal icd9 codes (@test-comorbid-calcs-icd9.R#376) 
  6. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/charlson.Rd 
  7. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/comorbid_df_to_mat.Rd 
  8. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/count_codes.Rd 
  9. Error: /home/hornik/tmp/scratch/Rtmp6UkrPZ/R.INSTALL5d4a610cc21f/icd/man/van_walraven.Rd 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted