Running ‘testthat.R’ [74s/103s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(cutpointr)
  > 
  > test_check("cutpointr")
  ── 1. Failure: Plotting with bootstrapping is silent (@test-cutpointr.R#109)  ──
  `plot(opt_cut)` produced warnings.
  
  ── 2. Failure: AUC calculation is correct and works with Inf and -Inf (@test-cut
  `auc_cutpointr` not equal to 0.428.
  1/1 mismatches
  [1] 0.42 - 0.428 == -0.00811
  
  ── 3. Failure: AUC calculation is correct and works with Inf and -Inf (@test-cut
  cp$AUC not equal to 0.428.
  1/1 mismatches
  [1] 0.42 - 0.428 == -0.00811
  
  ── 4. Error: Metric colnames that are already in cutpointr are modified (@test-c
  task 4 failed - "missing value where TRUE/FALSE needed"
  1: cutpointr(suicide, dsi, suicide, gender, method = oc_youden_normal, metric = metricfunc, 
         boot_runs = 5) at testthat/test-cutpointr.R:303
  2: cutpointr.default(suicide, dsi, suicide, gender, method = oc_youden_normal, metric = metricfunc, 
         boot_runs = 5)
  3: cutpointr_internal(x, class, subgroup, method, metric, pos_class, neg_class, direction, 
         boot_runs, use_midpoints, break_ties, na.rm, allowParallel, predictor, outcome, 
         mod_name, subgroup_var, tol_metric, ...)
  4: dat %>% dplyr::transmute_(boot = ~purrr::map2(dat$data, dat$pos_class, function(g, 
         pc) {
         boot_g <- foreach::foreach(rep = 1:boot_runs, .combine = rbind, .export = c("method", 
             "direction", "metric", "break_ties", "neg_class", "mn", "use_midpoints", 
             "predictor", "outcome", "tol_metric")) %seq_or_par% {
             b_ind <- simple_boot(g, outcome)
             optcut_b <- method(data = g[b_ind, ], x = predictor, metric_func = metric, 
                 class = outcome, direction = direction, pos_class = pc, neg_class = neg_class, 
                 tol_metric = tol_metric, use_midpoints = use_midpoints, ...)
             optcut_b <- check_method_cols(optcut_b)
             optcut_b <- tibble::as_tibble(optcut_b)
             optcut_b <- apply_break_ties(optcut_b, break_ties)
             if (!(has_column(optcut_b, "roc_curve"))) {
                 roc_curve_b <- roc(data = g[b_ind, ], x = predictor, class = outcome, 
                     pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
                 roc_curve_b <- tidyr::nest_(roc_curve_b, key_col = "roc_curve")
                 optcut_b <- dplyr::bind_cols(optcut_b, roc_curve_b)
             }
             opt_ind_b <- get_opt_ind(roc_curve = optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_b <- auc(tpr = optcut_b$roc_curve[[1]]$tpr, fpr = optcut_b$roc_curve[[1]]$fpr)
             Sens_Spec_b <- sesp_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             Acc_b <- accuracy_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)[, "accuracy"]
             kap_b <- kappa_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             metric_b <- metric(tp = optcut_b$roc_curve[[1]]$tp[opt_ind_b], fp = optcut_b$roc_curve[[1]]$fp[opt_ind_b], 
                 tn = optcut_b$roc_curve[[1]]$tn[opt_ind_b], fn = optcut_b$roc_curve[[1]]$fn[opt_ind_b])
             metric_b <- check_metric_name(metric_b)
             roc_curve_oob <- roc(data = g[-b_ind, ], x = predictor, class = outcome, 
                 pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
             opt_ind_oob <- get_opt_ind(roc_curve = roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_oob <- auc(tpr = roc_curve_oob$tpr, fpr = roc_curve_oob$fpr)
             Sens_Spec_oob <- sesp_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             Acc_oob <- accuracy_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)[, "accuracy"]
             kap_oob <- kappa_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             metric_oob <- metric(tp = roc_curve_oob$tp[opt_ind_oob], fp = roc_curve_oob$fp[opt_ind_oob], 
                 tn = roc_curve_oob$tn[opt_ind_oob], fn = roc_curve_oob$fn[opt_ind_oob])
             metric_oob <- check_metric_name(metric_oob)
             mn <- make.names(colnames(metric_oob))
             bootstrap <- tibble::tibble(optimal_cutpoint = optcut_b$optimal_cutpoint, 
                 AUC_b = auc_b, AUC_oob = auc_oob)
             bootstrap <- add_list(bootstrap, metric_b[, mn], paste0(mn, "_b"))
             bootstrap <- add_list(bootstrap, metric_oob[, mn], paste0(mn, "_oob"))
             bootstrap <- add_list(bootstrap, Acc_b, "acc_b")
             bootstrap <- add_list(bootstrap, Acc_oob, "acc_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "sensitivity"], "sensitivity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "sensitivity"], "sensitivity_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "specificity"], "specificity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "specificity"], "specificity_oob")
             bootstrap <- add_list(bootstrap, kap_b[, "cohens_kappa"], "kappa_b")
             bootstrap <- add_list(bootstrap, kap_oob[, "cohens_kappa"], "kappa_oob")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tp[opt_ind_b], "TP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fp[opt_ind_b], "FP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tn[opt_ind_b], "TN_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fn[opt_ind_b], "FN_b")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tp[opt_ind_oob], "TP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fp[opt_ind_oob], "FP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tn[opt_ind_oob], "TN_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fn[opt_ind_oob], "FN_oob")
             bootstrap$roc_curve_b = optcut_b$roc_curve
             roc_curve_oob <- tidyr::nest_(roc_curve_oob, key_col = "roc_curve_oob")
             bootstrap <- dplyr::bind_cols(bootstrap, roc_curve_oob)
             return(bootstrap)
         }
         return(boot_g)
     }))
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  ...
  13: transmute_.default(., boot = ~purrr::map2(dat$data, dat$pos_class, function(g, pc) {
         boot_g <- foreach::foreach(rep = 1:boot_runs, .combine = rbind, .export = c("method", 
             "direction", "metric", "break_ties", "neg_class", "mn", "use_midpoints", 
             "predictor", "outcome", "tol_metric")) %seq_or_par% {
             b_ind <- simple_boot(g, outcome)
             optcut_b <- method(data = g[b_ind, ], x = predictor, metric_func = metric, 
                 class = outcome, direction = direction, pos_class = pc, neg_class = neg_class, 
                 tol_metric = tol_metric, use_midpoints = use_midpoints, ...)
             optcut_b <- check_method_cols(optcut_b)
             optcut_b <- tibble::as_tibble(optcut_b)
             optcut_b <- apply_break_ties(optcut_b, break_ties)
             if (!(has_column(optcut_b, "roc_curve"))) {
                 roc_curve_b <- roc(data = g[b_ind, ], x = predictor, class = outcome, 
                     pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
                 roc_curve_b <- tidyr::nest_(roc_curve_b, key_col = "roc_curve")
                 optcut_b <- dplyr::bind_cols(optcut_b, roc_curve_b)
             }
             opt_ind_b <- get_opt_ind(roc_curve = optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_b <- auc(tpr = optcut_b$roc_curve[[1]]$tpr, fpr = optcut_b$roc_curve[[1]]$fpr)
             Sens_Spec_b <- sesp_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             Acc_b <- accuracy_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)[, "accuracy"]
             kap_b <- kappa_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             metric_b <- metric(tp = optcut_b$roc_curve[[1]]$tp[opt_ind_b], fp = optcut_b$roc_curve[[1]]$fp[opt_ind_b], 
                 tn = optcut_b$roc_curve[[1]]$tn[opt_ind_b], fn = optcut_b$roc_curve[[1]]$fn[opt_ind_b])
             metric_b <- check_metric_name(metric_b)
             roc_curve_oob <- roc(data = g[-b_ind, ], x = predictor, class = outcome, 
                 pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
             opt_ind_oob <- get_opt_ind(roc_curve = roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_oob <- auc(tpr = roc_curve_oob$tpr, fpr = roc_curve_oob$fpr)
             Sens_Spec_oob <- sesp_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             Acc_oob <- accuracy_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)[, "accuracy"]
             kap_oob <- kappa_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             metric_oob <- metric(tp = roc_curve_oob$tp[opt_ind_oob], fp = roc_curve_oob$fp[opt_ind_oob], 
                 tn = roc_curve_oob$tn[opt_ind_oob], fn = roc_curve_oob$fn[opt_ind_oob])
             metric_oob <- check_metric_name(metric_oob)
             mn <- make.names(colnames(metric_oob))
             bootstrap <- tibble::tibble(optimal_cutpoint = optcut_b$optimal_cutpoint, 
                 AUC_b = auc_b, AUC_oob = auc_oob)
             bootstrap <- add_list(bootstrap, metric_b[, mn], paste0(mn, "_b"))
             bootstrap <- add_list(bootstrap, metric_oob[, mn], paste0(mn, "_oob"))
             bootstrap <- add_list(bootstrap, Acc_b, "acc_b")
             bootstrap <- add_list(bootstrap, Acc_oob, "acc_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "sensitivity"], "sensitivity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "sensitivity"], "sensitivity_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "specificity"], "specificity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "specificity"], "specificity_oob")
             bootstrap <- add_list(bootstrap, kap_b[, "cohens_kappa"], "kappa_b")
             bootstrap <- add_list(bootstrap, kap_oob[, "cohens_kappa"], "kappa_oob")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tp[opt_ind_b], "TP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fp[opt_ind_b], "FP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tn[opt_ind_b], "TN_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fn[opt_ind_b], "FN_b")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tp[opt_ind_oob], "TP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fp[opt_ind_oob], "FP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tn[opt_ind_oob], "TN_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fn[opt_ind_oob], "FN_oob")
             bootstrap$roc_curve_b = optcut_b$roc_curve
             roc_curve_oob <- tidyr::nest_(roc_curve_oob, key_col = "roc_curve_oob")
             bootstrap <- dplyr::bind_cols(bootstrap, roc_curve_oob)
             return(bootstrap)
         }
         return(boot_g)
     }))
  14: transmute(.data, !!!dots)
  15: transmute.default(.data, !!!dots)
  16: mutate(.data, !!!dots)
  17: mutate.tbl_df(.data, !!!dots)
  18: mutate_impl(.data, dots, caller_env())
  19: purrr::map2(dat$data, dat$pos_class, function(g, pc) {
         boot_g <- foreach::foreach(rep = 1:boot_runs, .combine = rbind, .export = c("method", 
             "direction", "metric", "break_ties", "neg_class", "mn", "use_midpoints", 
             "predictor", "outcome", "tol_metric")) %seq_or_par% {
             b_ind <- simple_boot(g, outcome)
             optcut_b <- method(data = g[b_ind, ], x = predictor, metric_func = metric, 
                 class = outcome, direction = direction, pos_class = pc, neg_class = neg_class, 
                 tol_metric = tol_metric, use_midpoints = use_midpoints, ...)
             optcut_b <- check_method_cols(optcut_b)
             optcut_b <- tibble::as_tibble(optcut_b)
             optcut_b <- apply_break_ties(optcut_b, break_ties)
             if (!(has_column(optcut_b, "roc_curve"))) {
                 roc_curve_b <- roc(data = g[b_ind, ], x = predictor, class = outcome, 
                     pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
                 roc_curve_b <- tidyr::nest_(roc_curve_b, key_col = "roc_curve")
                 optcut_b <- dplyr::bind_cols(optcut_b, roc_curve_b)
             }
             opt_ind_b <- get_opt_ind(roc_curve = optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_b <- auc(tpr = optcut_b$roc_curve[[1]]$tpr, fpr = optcut_b$roc_curve[[1]]$fpr)
             Sens_Spec_b <- sesp_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             Acc_b <- accuracy_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)[, "accuracy"]
             kap_b <- kappa_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_b)
             metric_b <- metric(tp = optcut_b$roc_curve[[1]]$tp[opt_ind_b], fp = optcut_b$roc_curve[[1]]$fp[opt_ind_b], 
                 tn = optcut_b$roc_curve[[1]]$tn[opt_ind_b], fn = optcut_b$roc_curve[[1]]$fn[opt_ind_b])
             metric_b <- check_metric_name(metric_b)
             roc_curve_oob <- roc(data = g[-b_ind, ], x = predictor, class = outcome, 
                 pos_class = pc, neg_class = neg_class, direction = direction, silent = TRUE)
             opt_ind_oob <- get_opt_ind(roc_curve = roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction)
             auc_oob <- auc(tpr = roc_curve_oob$tpr, fpr = roc_curve_oob$fpr)
             Sens_Spec_oob <- sesp_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             Acc_oob <- accuracy_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)[, "accuracy"]
             kap_oob <- kappa_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
                 direction = direction, opt_ind = opt_ind_oob)
             metric_oob <- metric(tp = roc_curve_oob$tp[opt_ind_oob], fp = roc_curve_oob$fp[opt_ind_oob], 
                 tn = roc_curve_oob$tn[opt_ind_oob], fn = roc_curve_oob$fn[opt_ind_oob])
             metric_oob <- check_metric_name(metric_oob)
             mn <- make.names(colnames(metric_oob))
             bootstrap <- tibble::tibble(optimal_cutpoint = optcut_b$optimal_cutpoint, 
                 AUC_b = auc_b, AUC_oob = auc_oob)
             bootstrap <- add_list(bootstrap, metric_b[, mn], paste0(mn, "_b"))
             bootstrap <- add_list(bootstrap, metric_oob[, mn], paste0(mn, "_oob"))
             bootstrap <- add_list(bootstrap, Acc_b, "acc_b")
             bootstrap <- add_list(bootstrap, Acc_oob, "acc_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "sensitivity"], "sensitivity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "sensitivity"], "sensitivity_oob")
             bootstrap <- add_list(bootstrap, Sens_Spec_b[, "specificity"], "specificity_b")
             bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "specificity"], "specificity_oob")
             bootstrap <- add_list(bootstrap, kap_b[, "cohens_kappa"], "kappa_b")
             bootstrap <- add_list(bootstrap, kap_oob[, "cohens_kappa"], "kappa_oob")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tp[opt_ind_b], "TP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fp[opt_ind_b], "FP_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tn[opt_ind_b], "TN_b")
             bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fn[opt_ind_b], "FN_b")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tp[opt_ind_oob], "TP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fp[opt_ind_oob], "FP_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$tn[opt_ind_oob], "TN_oob")
             bootstrap <- add_list(bootstrap, roc_curve_oob$fn[opt_ind_oob], "FN_oob")
             bootstrap$roc_curve_b = optcut_b$roc_curve
             roc_curve_oob <- tidyr::nest_(roc_curve_oob, key_col = "roc_curve_oob")
             bootstrap <- dplyr::bind_cols(bootstrap, roc_curve_oob)
             return(bootstrap)
         }
         return(boot_g)
     })
  20: .f(.x[[i]], .y[[i]], ...)
  21: foreach::foreach(rep = 1:boot_runs, .combine = rbind, .export = c("method", "direction", 
         "metric", "break_ties", "neg_class", "mn", "use_midpoints", "predictor", "outcome", 
         "tol_metric")) %seq_or_par% {
         b_ind <- simple_boot(g, outcome)
         optcut_b <- method(data = g[b_ind, ], x = predictor, metric_func = metric, class = outcome, 
             direction = direction, pos_class = pc, neg_class = neg_class, tol_metric = tol_metric, 
             use_midpoints = use_midpoints, ...)
         optcut_b <- check_method_cols(optcut_b)
         optcut_b <- tibble::as_tibble(optcut_b)
         optcut_b <- apply_break_ties(optcut_b, break_ties)
         if (!(has_column(optcut_b, "roc_curve"))) {
             roc_curve_b <- roc(data = g[b_ind, ], x = predictor, class = outcome, pos_class = pc, 
                 neg_class = neg_class, direction = direction, silent = TRUE)
             roc_curve_b <- tidyr::nest_(roc_curve_b, key_col = "roc_curve")
             optcut_b <- dplyr::bind_cols(optcut_b, roc_curve_b)
         }
         opt_ind_b <- get_opt_ind(roc_curve = optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction)
         auc_b <- auc(tpr = optcut_b$roc_curve[[1]]$tpr, fpr = optcut_b$roc_curve[[1]]$fpr)
         Sens_Spec_b <- sesp_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_b)
         Acc_b <- accuracy_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_b)[, "accuracy"]
         kap_b <- kappa_from_oc(optcut_b$roc_curve[[1]], oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_b)
         metric_b <- metric(tp = optcut_b$roc_curve[[1]]$tp[opt_ind_b], fp = optcut_b$roc_curve[[1]]$fp[opt_ind_b], 
             tn = optcut_b$roc_curve[[1]]$tn[opt_ind_b], fn = optcut_b$roc_curve[[1]]$fn[opt_ind_b])
         metric_b <- check_metric_name(metric_b)
         roc_curve_oob <- roc(data = g[-b_ind, ], x = predictor, class = outcome, pos_class = pc, 
             neg_class = neg_class, direction = direction, silent = TRUE)
         opt_ind_oob <- get_opt_ind(roc_curve = roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction)
         auc_oob <- auc(tpr = roc_curve_oob$tpr, fpr = roc_curve_oob$fpr)
         Sens_Spec_oob <- sesp_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_oob)
         Acc_oob <- accuracy_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_oob)[, "accuracy"]
         kap_oob <- kappa_from_oc(roc_curve_oob, oc = unlist(optcut_b$optimal_cutpoint), 
             direction = direction, opt_ind = opt_ind_oob)
         metric_oob <- metric(tp = roc_curve_oob$tp[opt_ind_oob], fp = roc_curve_oob$fp[opt_ind_oob], 
             tn = roc_curve_oob$tn[opt_ind_oob], fn = roc_curve_oob$fn[opt_ind_oob])
         metric_oob <- check_metric_name(metric_oob)
         mn <- make.names(colnames(metric_oob))
         bootstrap <- tibble::tibble(optimal_cutpoint = optcut_b$optimal_cutpoint, AUC_b = auc_b, 
             AUC_oob = auc_oob)
         bootstrap <- add_list(bootstrap, metric_b[, mn], paste0(mn, "_b"))
         bootstrap <- add_list(bootstrap, metric_oob[, mn], paste0(mn, "_oob"))
         bootstrap <- add_list(bootstrap, Acc_b, "acc_b")
         bootstrap <- add_list(bootstrap, Acc_oob, "acc_oob")
         bootstrap <- add_list(bootstrap, Sens_Spec_b[, "sensitivity"], "sensitivity_b")
         bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "sensitivity"], "sensitivity_oob")
         bootstrap <- add_list(bootstrap, Sens_Spec_b[, "specificity"], "specificity_b")
         bootstrap <- add_list(bootstrap, Sens_Spec_oob[, "specificity"], "specificity_oob")
         bootstrap <- add_list(bootstrap, kap_b[, "cohens_kappa"], "kappa_b")
         bootstrap <- add_list(bootstrap, kap_oob[, "cohens_kappa"], "kappa_oob")
         bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tp[opt_ind_b], "TP_b")
         bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fp[opt_ind_b], "FP_b")
         bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$tn[opt_ind_b], "TN_b")
         bootstrap <- add_list(bootstrap, optcut_b$roc_curve[[1]]$fn[opt_ind_b], "FN_b")
         bootstrap <- add_list(bootstrap, roc_curve_oob$tp[opt_ind_oob], "TP_oob")
         bootstrap <- add_list(bootstrap, roc_curve_oob$fp[opt_ind_oob], "FP_oob")
         bootstrap <- add_list(bootstrap, roc_curve_oob$tn[opt_ind_oob], "TN_oob")
         bootstrap <- add_list(bootstrap, roc_curve_oob$fn[opt_ind_oob], "FN_oob")
         bootstrap$roc_curve_b = optcut_b$roc_curve
         roc_curve_oob <- tidyr::nest_(roc_curve_oob, key_col = "roc_curve_oob")
         bootstrap <- dplyr::bind_cols(bootstrap, roc_curve_oob)
         return(bootstrap)
     }
  22: e$fun(obj, substitute(ex), parent.frame(), e$data)
  
  ── 5. Failure: Results for p_chisquared are equal to results by OptimalCutpoints
  round(opt_cut_cp$optimal_cutpoint, 4) not equal to c(0.9335, 0.5676).
  2/2 mismatches (average diff: 0.44)
  [1] 0.431 - 0.933 == -0.502
  [2] 0.946 - 0.568 ==  0.379
  
  ── 6. Failure: Results for prod_sens_spec are equal to results by OptimalCutpoin
  round(opt_cut_cp$optimal_cutpoint, 4) not equal to c(0.7998, 0.6371).
  2/2 mismatches (average diff: 0.126)
  [1] 0.778 - 0.800 == -0.0215
  [2] 0.406 - 0.637 == -0.2314
  
  ── 7. Error: Results for abs_d_ppv_npv are equal to results by OptimalCutpoints 
  non-numeric argument to mathematical function
  1: expect_equal(round(opt_cut_cp$optimal_cutpoint, 4), c(0.2501, 0.6781)) at testthat/test-cutpointr.R:532
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  ── 8. Failure: Results for sum_ppv_npv are equal to results by OptimalCutpoints 
  round(opt_cut_cp$optimal_cutpoint, 4) not equal to c(-0.7339, 1.7835).
  2/2 mismatches (average diff: 0.932)
  [1] 1.10 - -0.734 == 1.8326
  [2] 1.81 -  1.784 == 0.0315
  
  ── 9. Failure: Results for prod_ppv_npv are equal to results by OptimalCutpoints
  round(opt_cut_cp$optimal_cutpoint, 4) not equal to c(-0.7339, 1.7835).
  2/2 mismatches (average diff: 1.47)
  [1] 1.099 - -0.734 ==  1.83
  [2] 0.678 -  1.784 == -1.11
  
  ── 10. Error: Results for accuracy are equal to results by OptimalCutpoints (@te
  non-numeric argument to mathematical function
  1: expect_equal(round(opt_cut_cp$optimal_cutpoint, 4), c(0.9771, 0.0744)) at testthat/test-cutpointr.R:583
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  
  ── 11. Failure: Results for misclassification_cost are equal to results by Optim
  round(opt_cut_cp$optimal_cutpoint, 4) not equal to c(-0.7498, -0.0824).
  2/2 mismatches (average diff: 0.342)
  [1] -0.297 - -0.7498 == 0.453
  [2]  0.148 - -0.0824 == 0.231
  
  ── 12. Failure: LOESS smoothing does not return warnings or errors (@test-cutpoi
  `suppressMessages(...)` produced warnings.
  
  ── 13. Failure: LOESS smoothing does not return warnings or errors (@test-cutpoi
  round(cp$optimal_cutpoint, 2) not equal to c(-1.29, 1.01).
  2/2 mismatches (average diff: 2.71)
  [1]  0.87 - -1.29 ==  2.16
  [2] -2.25 -  1.01 == -3.26
  
  ── 14. Failure: bootstrapped cutpoints lead to plausible results (@test-cutpoint
  cp$optimal_cutpoint not equal to 1.9.
  1/1 mismatches
  [1] 2.1 - 1.9 == 0.2
  
  ── 15. Failure: bootstrapped cutpoints lead to plausible results (@test-cutpoint
  cp$optimal_cutpoint not equal to c(2.2, 3.2).
  2/2 mismatches (average diff: 0.25)
  [1] 2.1 - 2.2 == -0.1
  [2] 3.6 - 3.2 ==  0.4
  
  ── 16. Failure: bootstrapped cutpoints lead to plausible results (@test-cutpoint
  cp$optimal_cutpoint not equal to c(2.1, 2.2).
  2/2 mismatches (average diff: 0.332)
  [1] 2.60 - 2.1 == 0.500
  [2] 2.36 - 2.2 == 0.164
  
  ── 17. Failure: summary is printed correctly (@test-cutpointr.R#1179)  ─────────
  `print\(scp\)` does not match "accuracy_oob 0.8342".
  Actual value: "Method: oc_youden_kernel \\nPredictor: dsi \\nOutcome: suicide \\nDirection: >= \\nNr\. of bootstraps: 10 \\n\\n optimal_cutpoint accuracy    acc sensitivity specificity    AUC n_pos n_neg\\n           1\.1742   0\.8647 0\.8647      0\.8889      0\.8629 0\.9238    36   496\\n\\nCutpoint 1\.17422055119795:\\n          observation\\nprediction yes  no\\n       yes  32  68\\n       no    4 428\\n\\n\\nPredictor summary: \\n Min\. 5% 1st Qu\. Median   Mean 3rd Qu\. 95% Max\.     SD\\n    0  0       0      0 0\.9211       1   5   11 1\.8527\\n\\nPredictor summary per class: \\n    Min\.   5% 1st Qu\. Median   Mean 3rd Qu\.  95% Max     SD\\nno     0 0\.00       0      0 0\.6331       0 4\.00  10 1\.4122\\nyes    0 0\.75       4      5 4\.8889       6 9\.25  11 2\.5498\\n\\nBootstrap summary: \\n         Variable   Min\.     5% 1st Qu\. Median   Mean 3rd Qu\.    95%   Max\.\\n optimal_cutpoint 1\.1552 1\.1557  1\.1596 1\.1646 1\.2635  1\.1859 1\.6977 2\.0997\\n            AUC_b 0\.8324 0\.8655  0\.9157 0\.9268 0\.9195  0\.9357 0\.9511 0\.9587\\n          AUC_oob 0\.8353 0\.8555  0\.8873 0\.9208 0\.9171  0\.9517 0\.9631 0\.9647\\n       accuracy_b 0\.8383 0\.8400  0\.8482 0\.8618 0\.8618  0\.8741 0\.8864 0\.8872\\n     accuracy_oob 0\.8515 0\.8521  0\.8638 0\.8723 0\.8735  0\.8794 0\.8992 0\.9077\\n            acc_b 0\.8383 0\.8400  0\.8482 0\.8618 0\.8618  0\.8741 0\.8864 0\.8872\\n          acc_oob 0\.8515 0\.8521  0\.8638 0\.8723 0\.8735  0\.8794 0\.8992 0\.9077\\n    sensitivity_b 0\.7879 0\.8108  0\.8415 0\.8823 0\.8843  0\.9184 0\.9647 0\.9706\\n  sensitivity_oob 0\.6000 0\.6300  0\.7912 0\.9028 0\.8506  0\.9353 0\.9735 1\.0000\\n    specificity_b 0\.8350 0\.8369  0\.8439 0\.8583 0\.8599  0\.8752 0\.8854 0\.8858\\n  specificity_oob 0\.8441 0\.8454  0\.8574 0\.8771 0\.8741  0\.8904 0\.8990 0\.9027\\n          kappa_b 0\.3283 0\.3399  0\.3674 0\.3995 0\.4029  0\.4348 0\.4711 0\.4798\\n        kappa_oob 0\.2805 0\.2845  0\.3739 0\.4115 0\.4034  0\.4607 0\.4832 0\.4876\\n     SD\\n 0\.2943\\n 0\.0341\\n 0\.0422\\n 0\.0175\\n 0\.0169\\n 0\.0175\\n 0\.0169\\n 0\.0575\\n 0\.1305\\n 0\.0189\\n 0\.0206\\n 0\.0488\\n 0\.0730"
  
  ── 18. Failure: summary is printed correctly (@test-cutpointr.R#1195)  ─────────
  `print\(scp\)` does not match "accuracy_oob 0.8201".
  Actual value: "Method: oc_youden_normal \\nPredictor: dsi \\nOutcome: suicide \\nDirection: >= \\nSubgroups: female, male \\nNr\. of bootstraps: 10 \\n\\nSubgroup: female \\n-------------------------------------------------------------------------------- \\n optimal_cutpoint accuracy    acc sensitivity specificity    AUC n_pos n_neg\\n           2\.4778   0\.8954 0\.8954      0\.8148      0\.9014 0\.9446    27   365\\n\\nCutpoint 2\.47775393352595:\\n          observation\\nprediction yes  no\\n       yes  22  36\\n       no    5 329\\n\\n\\nPredictor summary: \\n Min\. 5% 1st Qu\. Median   Mean 3rd Qu\. 95% Max\.     SD\\n    0  0       0      0 0\.8393       1   5   10 1\.7452\\n\\nPredictor summary per class: \\n    Min\.  5% 1st Qu\. Median   Mean 3rd Qu\. 95% Max     SD\\nno     0 0\.0       0      0 0\.5479       0   4  10 1\.3181\\nyes    0 1\.3       4      5 4\.7778       6   7   9 2\.0444\\n\\nBootstrap summary: \\n         Variable   Min\.     5% 1st Qu\. Median   Mean 3rd Qu\.    95%   Max\.\\n optimal_cutpoint 2\.1606 2\.2354  2\.3398 2\.4582 2\.4575  2\.5591 2\.6904 2\.7552\\n            AUC_b 0\.8903 0\.9003  0\.9283 0\.9554 0\.9465  0\.9661 0\.9790 0\.9790\\n          AUC_oob 0\.9051 0\.9055  0\.9086 0\.9552 0\.9445  0\.9739 0\.9802 0\.9805\\n       accuracy_b 0\.8673 0\.8696  0\.8871 0\.9043 0\.8980  0\.9133 0\.9133 0\.9133\\n     accuracy_oob 0\.8667 0\.8684  0\.8749 0\.8931 0\.8906  0\.9038 0\.9105 0\.9130\\n            acc_b 0\.8673 0\.8696  0\.8871 0\.9043 0\.8980  0\.9133 0\.9133 0\.9133\\n          acc_oob 0\.8667 0\.8684  0\.8749 0\.8931 0\.8906  0\.9038 0\.9105 0\.9130\\n    sensitivity_b 0\.7143 0\.7304  0\.7659 0\.8074 0\.8110  0\.8241 0\.9264 0\.9524\\n  sensitivity_oob 0\.6923 0\.7022  0\.7778 0\.8397 0\.8333  0\.8938 0\.9625 1\.0000\\n    specificity_b 0\.8737 0\.8786  0\.8934 0\.9117 0\.9040  0\.9141 0\.9208 0\.9210\\n  specificity_oob 0\.8769 0\.8798  0\.8864 0\.8988 0\.8962  0\.9031 0\.9129 0\.9130\\n          kappa_b 0\.3128 0\.3368  0\.3946 0\.4699 0\.4496  0\.5013 0\.5339 0\.5445\\n        kappa_oob 0\.3747 0\.3770  0\.3877 0\.4385 0\.4558  0\.5024 0\.5846 0\.6023\\n     SD\\n 0\.1727\\n 0\.0294\\n 0\.0334\\n 0\.0176\\n 0\.0167\\n 0\.0176\\n 0\.0167\\n 0\.0699\\n 0\.0950\\n 0\.0162\\n 0\.0122\\n 0\.0750\\n 0\.0803\\n\\nSubgroup: male \\n-------------------------------------------------------------------------------- \\n optimal_cutpoint accuracy    acc sensitivity specificity    AUC n_pos n_neg\\n           3\.1723   0\.8643 0\.8643      0\.6667      0\.8779 0\.8617     9   131\\n\\nCutpoint 3\.17225507835137:\\n          observation\\nprediction yes  no\\n       yes   6  16\\n       no    3 115\\n\\n\\nPredictor summary: \\n Min\. 5% 1st Qu\. Median Mean 3rd Qu\. 95% Max\.     SD\\n    0  0       0      0 1\.15       1   6   11 2\.1151\\n\\nPredictor summary per class: \\n    Min\.  5% 1st Qu\. Median   Mean 3rd Qu\.  95% Max     SD\\nno     0 0\.0       0      0 0\.8702       1  5\.0   6 1\.6286\\nyes    0 0\.4       3      4 5\.2222       8 10\.6  11 3\.8333\\n\\nBootstrap summary: \\n         Variable   Min\.     5% 1st Qu\. Median   Mean 3rd Qu\.    95%   Max\.\\n optimal_cutpoint 2\.6337 2\.7310  3\.1262 3\.2497 3\.3226  3\.6064 3\.8765 3\.9423\\n            AUC_b 0\.7184 0\.7634  0\.8490 0\.8848 0\.8830  0\.9377 0\.9795 0\.9859\\n          AUC_oob 0\.6275 0\.6401  0\.7949 0\.8636 0\.8455  0\.9492 0\.9854 0\.9967\\n       accuracy_b 0\.8000 0\.8032  0\.8179 0\.8429 0\.8421  0\.8607 0\.8864 0\.8929\\n     accuracy_oob 0\.7872 0\.8066  0\.8373 0\.8751 0\.8693  0\.9065 0\.9160 0\.9184\\n            acc_b 0\.8000 0\.8032  0\.8179 0\.8429 0\.8421  0\.8607 0\.8864 0\.8929\\n          acc_oob 0\.7872 0\.8066  0\.8373 0\.8751 0\.8693  0\.9065 0\.9160 0\.9184\\n    sensitivity_b 0\.5385 0\.5774  0\.6906 0\.7386 0\.7792  0\.8854 1\.0000 1\.0000\\n  sensitivity_oob 0\.3333 0\.3633  0\.5000 0\.5000 0\.6233  0\.8750 1\.0000 1\.0000\\n    specificity_b 0\.8145 0\.8149  0\.8250 0\.8538 0\.8506  0\.8714 0\.8839 0\.8889\\n  specificity_oob 0\.8000 0\.8180  0\.8651 0\.9018 0\.8878  0\.9148 0\.9369 0\.9375\\n          kappa_b 0\.2383 0\.2427  0\.2729 0\.3426 0\.3267  0\.3632 0\.4038 0\.4317\\n        kappa_oob 0\.1031 0\.1061  0\.2179 0\.2928 0\.2800  0\.3560 0\.4324 0\.4651\\n     SD\\n 0\.4112\\n 0\.0799\\n 0\.1286\\n 0\.0306\\n 0\.0436\\n 0\.0306\\n 0\.0436\\n 0\.1559\\n 0\.2658\\n 0\.0270\\n 0\.0439\\n 0\.0621\\n 0\.1169"
  
  ── 19. Failure: summary is printed correctly (@test-cutpointr.R#1211)  ─────────
  `print\(scp\)` does not match "accuracy_oob 0.8163".
  Actual value: "Method: oc_youden_normal \\nPredictor: x \\nOutcome: class \\nDirection: >= \\nSubgroups: female, male \\nNr\. of bootstraps: 10 \\n\\nSubgroup: female \\n-------------------------------------------------------------------------------- \\n optimal_cutpoint accuracy    acc sensitivity specificity    AUC n_pos n_neg\\n           2\.4778   0\.8954 0\.8954      0\.8148      0\.9014 0\.9446    27   365\\n\\nCutpoint 2\.47775393352595:\\n          observation\\nprediction yes  no\\n       yes  22  36\\n       no    5 329\\n\\n\\nPredictor summary: \\n Min\. 5% 1st Qu\. Median   Mean 3rd Qu\. 95% Max\.     SD\\n    0  0       0      0 0\.8393       1   5   10 1\.7452\\n\\nPredictor summary per class: \\n    Min\.  5% 1st Qu\. Median   Mean 3rd Qu\. 95% Max     SD\\nno     0 0\.0       0      0 0\.5479       0   4  10 1\.3181\\nyes    0 1\.3       4      5 4\.7778       6   7   9 2\.0444\\n\\nBootstrap summary: \\n         Variable   Min\.     5% 1st Qu\. Median   Mean 3rd Qu\.    95%   Max\.\\n optimal_cutpoint 2\.2890 2\.2977  2\.3917 2\.4564 2\.4830  2\.6122 2\.6527 2\.6604\\n            AUC_b 0\.9097 0\.9114  0\.9302 0\.9482 0\.9425  0\.9544 0\.9660 0\.9675\\n          AUC_oob 0\.8697 0\.8941  0\.9282 0\.9448 0\.9411  0\.9593 0\.9768 0\.9775\\n       accuracy_b 0\.8469 0\.8561  0\.8820 0\.8980 0\.8903  0\.9024 0\.9084 0\.9107\\n     accuracy_oob 0\.8777 0\.8777  0\.8828 0\.8842 0\.8935  0\.9008 0\.9254 0\.9306\\n            acc_b 0\.8469 0\.8561  0\.8820 0\.8980 0\.8903  0\.9024 0\.9084 0\.9107\\n          acc_oob 0\.8777 0\.8777  0\.8828 0\.8842 0\.8935  0\.9008 0\.9254 0\.9306\\n    sensitivity_b 0\.6667 0\.6735  0\.7440 0\.8101 0\.7874  0\.8425 0\.8638 0\.8750\\n  sensitivity_oob 0\.6250 0\.6437  0\.7778 0\.8258 0\.8067  0\.8782 0\.9167 0\.9167\\n    specificity_b 0\.8571 0\.8656  0\.8855 0\.9043 0\.8973  0\.9083 0\.9171 0\.9180\\n  specificity_oob 0\.8740 0\.8771  0\.8881 0\.8974 0\.8991  0\.9035 0\.9311 0\.9407\\n          kappa_b 0\.2576 0\.3100  0\.4045 0\.4476 0\.4364  0\.4927 0\.5220 0\.5231\\n        kappa_oob 0\.2872 0\.3129  0\.4388 0\.4860 0\.4673  0\.5042 0\.5901 0\.6245\\n     SD\\n 0\.1372\\n 0\.0202\\n 0\.0314\\n 0\.0201\\n 0\.0184\\n 0\.0201\\n 0\.0184\\n 0\.0725\\n 0\.0987\\n 0\.0196\\n 0\.0194\\n 0\.0802\\n 0\.0963\\n\\nSubgroup: male \\n-------------------------------------------------------------------------------- \\n optimal_cutpoint accuracy    acc sensitivity specificity    AUC n_pos n_neg\\n           3\.1723   0\.8643 0\.8643      0\.6667      0\.8779 0\.8617     9   131\\n\\nCutpoint 3\.17225507835137:\\n          observation\\nprediction yes  no\\n       yes   6  16\\n       no    3 115\\n\\n\\nPredictor summary: \\n Min\. 5% 1st Qu\. Median Mean 3rd Qu\. 95% Max\.     SD\\n    0  0       0      0 1\.15       1   6   11 2\.1151\\n\\nPredictor summary per class: \\n    Min\.  5% 1st Qu\. Median   Mean 3rd Qu\.  95% Max     SD\\nno     0 0\.0       0      0 0\.8702       1  5\.0   6 1\.6286\\nyes    0 0\.4       3      4 5\.2222       8 10\.6  11 3\.8333\\n\\nBootstrap summary: \\n         Variable    Min\.     5% 1st Qu\. Median   Mean 3rd Qu\.    95%   Max\.\\n optimal_cutpoint  2\.3084 2\.6029  2\.9877 3\.1619 3\.3970  3\.4542 4\.8593 5\.9184\\n            AUC_b  0\.7480 0\.7778  0\.8742 0\.8929 0\.8934  0\.9439 0\.9748 1\.0000\\n          AUC_oob  0\.3333 0\.4940  0\.7394 0\.8909 0\.8179  0\.9493 0\.9901 0\.9902\\n       accuracy_b  0\.8286 0\.8414  0\.8589 0\.8750 0\.8829  0\.9000 0\.9386 0\.9643\\n     accuracy_oob  0\.7800 0\.7890  0\.8067 0\.8408 0\.8445  0\.8750 0\.9136 0\.9216\\n            acc_b  0\.8286 0\.8414  0\.8589 0\.8750 0\.8829  0\.9000 0\.9386 0\.9643\\n          acc_oob  0\.7800 0\.7890  0\.8067 0\.8408 0\.8445  0\.8750 0\.9136 0\.9216\\n    sensitivity_b  0\.5833 0\.5908  0\.6731 0\.7386 0\.7344  0\.7756 0\.9000 1\.0000\\n  sensitivity_oob  0\.0000 0\.0750  0\.3750 0\.7750 0\.6550  1\.0000 1\.0000 1\.0000\\n    specificity_b  0\.8516 0\.8581  0\.8676 0\.8906 0\.8951  0\.9157 0\.9443 0\.9632\\n  specificity_oob  0\.7885 0\.7956  0\.8206 0\.8475 0\.8605  0\.8885 0\.9587 0\.9783\\n          kappa_b  0\.1837 0\.2290  0\.3707 0\.4495 0\.4183  0\.4797 0\.5585 0\.5995\\n        kappa_oob -0\.0370 0\.0219  0\.1697 0\.2466 0\.2595  0\.3374 0\.5271 0\.6236\\n     SD\\n 0\.9562\\n 0\.0723\\n 0\.2011\\n 0\.0377\\n 0\.0466\\n 0\.0377\\n 0\.0466\\n 0\.1169\\n 0\.3802\\n 0\.0341\\n 0\.0600\\n 0\.1191\\n 0\.1831"
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 352 SKIPPED: 0 FAILED: 19
  1. Failure: Plotting with bootstrapping is silent (@test-cutpointr.R#109) 
  2. Failure: AUC calculation is correct and works with Inf and -Inf (@test-cutpointr.R#142) 
  3. Failure: AUC calculation is correct and works with Inf and -Inf (@test-cutpointr.R#144) 
  4. Error: Metric colnames that are already in cutpointr are modified (@test-cutpointr.R#303) 
  5. Failure: Results for p_chisquared are equal to results by OptimalCutpoints (@test-cutpointr.R#498) 
  6. Failure: Results for prod_sens_spec are equal to results by OptimalCutpoints (@test-cutpointr.R#515) 
  7. Error: Results for abs_d_ppv_npv are equal to results by OptimalCutpoints (@test-cutpointr.R#532) 
  8. Failure: Results for sum_ppv_npv are equal to results by OptimalCutpoints (@test-cutpointr.R#549) 
  9. Failure: Results for prod_ppv_npv are equal to results by OptimalCutpoints (@test-cutpointr.R#566) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted