diff --git a/.github/workflows/R-CMD-check-no-suggests.yaml b/.github/workflows/R-CMD-check-no-suggests.yaml new file mode 100644 index 00000000..98cd63b0 --- /dev/null +++ b/.github/workflows/R-CMD-check-no-suggests.yaml @@ -0,0 +1,59 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# +# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends, +# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never +# installed, with the exception of testthat, knitr, and rmarkdown. The cache is +# never used to avoid accidentally restoring a cache containing a suggested +# dependency. +on: + push: + branches: [main, master] + pull_request: + +name: R-CMD-check-no-suggests.yaml + +permissions: read-all + +jobs: + check-no-suggests: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'release'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: '"hard"' + cache: false + extra-packages: | + any::rcmdcheck + any::testthat + any::knitr + any::rmarkdown + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/R/conf_mat.R b/R/conf_mat.R index 7a0b503e..c3b3303d 100644 --- a/R/conf_mat.R +++ b/R/conf_mat.R @@ -39,7 +39,7 @@ #' [summary.conf_mat()] for computing a large number of metrics from one #' confusion matrix. #' -#' @examples +#' @examplesIf rlang::is_installed(c("tidyr", "ggplot2")) #' library(dplyr) #' data("hpc_cv") #' @@ -342,7 +342,7 @@ flatten <- function(xtab, call = caller_env()) { #' #' [conf_mat()] #' -#' @examples +#' @examplesIf rlang::is_installed(c("tidyr")) #' data("two_class_example") #' #' cmat <- conf_mat(two_class_example, truth = "truth", estimate = "predicted") diff --git a/R/prob-gain_capture.R b/R/prob-gain_capture.R index 1cfd905c..0b900537 100644 --- a/R/prob-gain_capture.R +++ b/R/prob-gain_capture.R @@ -36,7 +36,7 @@ #' #' @template examples-binary-prob #' @template examples-multiclass-prob -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' # --------------------------------------------------------------------------- #' # Visualize gain_capture() #' diff --git a/R/prob-gain_curve.R b/R/prob-gain_curve.R index 19249c0e..dc4f10d8 100644 --- a/R/prob-gain_curve.R +++ b/R/prob-gain_curve.R @@ -72,7 +72,7 @@ #' @author Max Kuhn #' #' @template examples-binary-prob -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' # --------------------------------------------------------------------------- #' # `autoplot()` #' diff --git a/R/prob-lift_curve.R b/R/prob-lift_curve.R index 6ba69b32..7b792fc9 100644 --- a/R/prob-lift_curve.R +++ b/R/prob-lift_curve.R @@ -61,7 +61,7 @@ #' @author Max Kuhn #' #' @template examples-binary-prob -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' # --------------------------------------------------------------------------- #' # `autoplot()` #' diff --git a/R/prob-pr_curve.R b/R/prob-pr_curve.R index 36067c19..f4290488 100644 --- a/R/prob-pr_curve.R +++ b/R/prob-pr_curve.R @@ -27,7 +27,7 @@ #' #' @author Max Kuhn #' @template examples-binary-prob -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' # --------------------------------------------------------------------------- #' # `autoplot()` #' diff --git a/R/prob-roc_curve.R b/R/prob-roc_curve.R index 73dbc084..e4d3d43c 100644 --- a/R/prob-roc_curve.R +++ b/R/prob-roc_curve.R @@ -29,7 +29,7 @@ #' #' @author Max Kuhn #' @template examples-binary-prob -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' # --------------------------------------------------------------------------- #' # `autoplot()` #' diff --git a/R/surv-brier_survival.R b/R/surv-brier_survival.R index 2300bd72..2bf65eaa 100644 --- a/R/surv-brier_survival.R +++ b/R/surv-brier_survival.R @@ -19,13 +19,13 @@ #' #' @param ... The column identifier for the survival probabilities this #' should be a list column of data.frames corresponding to the output given when -#' predicting with [censored](https://censored.tidymodels.org/) model. This -#' should be an unquoted column name although this argument is passed by -#' expression and supports [quasiquotation][rlang::quasiquotation] (you can +#' predicting with [censored](https://censored.tidymodels.org/) model. This +#' should be an unquoted column name although this argument is passed by +#' expression and supports [quasiquotation][rlang::quasiquotation] (you can #' unquote column names). For `_vec()` functions, the dots are not used. -#' -#' @param estimate A list column of data.frames corresponding to the output -#' given when predicting with [censored](https://censored.tidymodels.org/) +#' +#' @param estimate A list column of data.frames corresponding to the output +#' given when predicting with [censored](https://censored.tidymodels.org/) #' model. See the details for more information regarding format. #' #' @details @@ -59,7 +59,9 @@ #' comparison of prognostic classification schemes for survival data,” #' _Statistics in Medicine_, vol. 18, no. 17-18, pp. 2529–2545, 1999. #' -#' @examples +#' @examplesIf rlang::is_installed(c("tidyr")) +#' # example code +#' #' library(dplyr) #' #' lung_surv %>% diff --git a/R/surv-brier_survival_integrated.R b/R/surv-brier_survival_integrated.R index 9654b160..2969b44b 100644 --- a/R/surv-brier_survival_integrated.R +++ b/R/surv-brier_survival_integrated.R @@ -43,7 +43,7 @@ #' and comparison of prognostic classification schemes for survival data,” #' Statistics in Medicine, vol. 18, no. 17-18, pp. 2529–2545, 1999. #' -#' @examples +#' @examplesIf rlang::is_installed(c("tidyr")) #' library(dplyr) #' #' lung_surv %>% diff --git a/R/surv-roc_auc_survival.R b/R/surv-roc_auc_survival.R index 6d7fa143..018a8d10 100644 --- a/R/surv-roc_auc_survival.R +++ b/R/surv-roc_auc_survival.R @@ -47,7 +47,7 @@ #' and comparison of prognostic classification schemes for survival data. #' _Statist. Med._, 18: 2529-2545. #' -#' @examples +#' @examplesIf rlang::is_installed(c("tidyr")) #' library(dplyr) #' #' lung_surv %>% diff --git a/R/surv-roc_curve_survival.R b/R/surv-roc_curve_survival.R index 3f90c120..b2d314b5 100644 --- a/R/surv-roc_curve_survival.R +++ b/R/surv-roc_curve_survival.R @@ -49,7 +49,7 @@ #' and comparison of prognostic classification schemes for survival data. #' _Statist. Med._, 18: 2529-2545. #' -#' @examples +#' @examplesIf rlang::is_installed(c("ggplot2")) #' result <- roc_curve_survival( #' lung_surv, #' truth = surv_obj, @@ -180,14 +180,14 @@ roc_curve_survival_impl <- function(truth, roc_curve_survival_impl_one <- function(event_time, delta, data, case_weights) { res <- dplyr::tibble(.threshold = sort(unique(c(-Inf, data$.pred_survival, Inf)), decreasing = TRUE)) - + obs_time_le_time <- event_time <= data$.eval_time obs_time_gt_time <- event_time > data$.eval_time n <- nrow(data) - + sensitivity_denom <- sum(obs_time_le_time * delta * data$.weight_censored * case_weights, na.rm = TRUE) specificity_denom <- sum(obs_time_gt_time * data$.weight_censored * case_weights, na.rm = TRUE) - + data_df <- data.frame( le_time = obs_time_le_time, ge_time = obs_time_gt_time, @@ -195,10 +195,10 @@ roc_curve_survival_impl_one <- function(event_time, delta, data, case_weights) { weight_censored = data$.weight_censored, case_weights = case_weights ) - + data_split <- vec_split(data_df, data$.pred_survival) data_split <- data_split$val[order(data_split$key)] - + specificity <- vapply( data_split, function(x) sum(x$ge_time * x$weight_censored * x$case_weights, na.rm = TRUE), @@ -217,14 +217,14 @@ roc_curve_survival_impl_one <- function(event_time, delta, data, case_weights) { function(x) sum(x$le_time * x$delta * x$weight_censored * x$case_weights, na.rm = TRUE), FUN.VALUE = numeric(1) ) - + sensitivity <- cumsum(sensitivity) sensitivity <- sensitivity / sensitivity_denom sensitivity <- dplyr::if_else(sensitivity > 1, 1, sensitivity) sensitivity <- dplyr::if_else(sensitivity < 0, 0, sensitivity) sensitivity <- c(0, sensitivity, 1) res$sensitivity <- sensitivity - + res } diff --git a/man/brier_survival.Rd b/man/brier_survival.Rd index 95dc2c57..7bbfaa8e 100644 --- a/man/brier_survival.Rd +++ b/man/brier_survival.Rd @@ -78,6 +78,9 @@ This method automatically groups by the \code{.eval_time} argument. Smaller values of the score are associated with better model performance. } \examples{ +\dontshow{if (rlang::is_installed(c("tidyr"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} +# example code + library(dplyr) lung_surv \%>\% @@ -85,6 +88,7 @@ lung_surv \%>\% truth = surv_obj, .pred ) +\dontshow{\}) # examplesIf} } \references{ E. Graf, C. Schmoor, W. Sauerbrei, and M. Schumacher, “Assessment and diff --git a/man/brier_survival_integrated.Rd b/man/brier_survival_integrated.Rd index e13ee193..5d85f108 100644 --- a/man/brier_survival_integrated.Rd +++ b/man/brier_survival_integrated.Rd @@ -90,6 +90,7 @@ internal data set \code{lung_surv} shows an example of the format. This method automatically groups by the \code{.eval_time} argument. } \examples{ +\dontshow{if (rlang::is_installed(c("tidyr"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(dplyr) lung_surv \%>\% @@ -97,6 +98,7 @@ lung_surv \%>\% truth = surv_obj, .pred ) +\dontshow{\}) # examplesIf} } \references{ E. Graf, C. Schmoor, W. Sauerbrei, and M. Schumacher, “Assessment diff --git a/man/ccc.Rd b/man/ccc.Rd index 5306edb1..03fa5b62 100644 --- a/man/ccc.Rd +++ b/man/ccc.Rd @@ -107,8 +107,8 @@ coefficient to evaluate reproducibility". \emph{Biometrics}, 53(4), } \seealso{ Other numeric metrics: -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -119,19 +119,19 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other consistency metrics: \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, -\code{\link{rsq}()} +\code{\link{rsq}()}, +\code{\link{rsq_trad}()} Other accuracy metrics: -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/conf_mat.Rd b/man/conf_mat.Rd index 490555cc..8768c01c 100644 --- a/man/conf_mat.Rd +++ b/man/conf_mat.Rd @@ -73,6 +73,7 @@ is implemented. The function requires that the factors have exactly the same levels. } \examples{ +\dontshow{if (rlang::is_installed(c("tidyr", "ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(dplyr) data("hpc_cv") @@ -118,6 +119,7 @@ library(ggplot2) autoplot(cm, type = "mosaic") autoplot(cm, type = "heatmap") +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=summary.conf_mat]{summary.conf_mat()}} for computing a large number of metrics from one diff --git a/man/gain_capture.Rd b/man/gain_capture.Rd index 4ccf41fa..1ab05ea3 100644 --- a/man/gain_capture.Rd +++ b/man/gain_capture.Rd @@ -175,6 +175,7 @@ gain_capture_vec( ) ) +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # Visualize gain_capture() @@ -182,7 +183,7 @@ gain_capture_vec( # 45 degree line, divided by the area of the shaded triangle. library(ggplot2) autoplot(gain_curve(two_class_example, truth, Class1)) - +\dontshow{\}) # examplesIf} } \references{ Engelmann, Bernd & Hayden, Evelyn & Tasche, Dirk (2003). diff --git a/man/gain_curve.Rd b/man/gain_curve.Rd index ced9bada..38eed6f4 100644 --- a/man/gain_curve.Rd +++ b/man/gain_curve.Rd @@ -137,6 +137,7 @@ data(two_class_example) # `"truth"`, it is the event of interest and we pass in probabilities for it. gain_curve(two_class_example, truth, Class1) +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # `autoplot()` @@ -161,7 +162,7 @@ hpc_cv \%>\% group_by(Resample) \%>\% gain_curve(obs, VF:L) \%>\% autoplot() - +\dontshow{\}) # examplesIf} } \references{ Engelmann, Bernd & Hayden, Evelyn & Tasche, Dirk (2003). diff --git a/man/huber_loss.Rd b/man/huber_loss.Rd index 7ab42eb9..e7475ec7 100644 --- a/man/huber_loss.Rd +++ b/man/huber_loss.Rd @@ -118,8 +118,8 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: diff --git a/man/huber_loss_pseudo.Rd b/man/huber_loss_pseudo.Rd index 13ef94b3..3246e05b 100644 --- a/man/huber_loss_pseudo.Rd +++ b/man/huber_loss_pseudo.Rd @@ -120,8 +120,8 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: diff --git a/man/iic.Rd b/man/iic.Rd index 530bf8bd..d6f52aa5 100644 --- a/man/iic.Rd +++ b/man/iic.Rd @@ -104,8 +104,8 @@ permeability?" \emph{Science of the Total Environment}. 586: 466-472. \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{mae}()}, \code{\link{mape}()}, \code{\link{mase}()}, @@ -115,14 +115,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{mae}()}, \code{\link{mape}()}, \code{\link{mase}()}, diff --git a/man/lift_curve.Rd b/man/lift_curve.Rd index f64e8c87..d4777a9d 100644 --- a/man/lift_curve.Rd +++ b/man/lift_curve.Rd @@ -135,6 +135,7 @@ data(two_class_example) # `"truth"`, it is the event of interest and we pass in probabilities for it. lift_curve(two_class_example, truth, Class1) +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # `autoplot()` @@ -156,7 +157,7 @@ hpc_cv \%>\% group_by(Resample) \%>\% lift_curve(obs, VF:L) \%>\% autoplot() - +\dontshow{\}) # examplesIf} } \seealso{ Other curve metrics: diff --git a/man/mae.Rd b/man/mae.Rd index 1059a945..e4462d8f 100644 --- a/man/mae.Rd +++ b/man/mae.Rd @@ -84,8 +84,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mape}()}, \code{\link{mase}()}, @@ -95,14 +95,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mape}()}, \code{\link{mase}()}, diff --git a/man/mape.Rd b/man/mape.Rd index 52f4400b..69a3c25c 100644 --- a/man/mape.Rd +++ b/man/mape.Rd @@ -88,8 +88,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mase}()}, @@ -99,14 +99,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mase}()}, diff --git a/man/mase.Rd b/man/mase.Rd index b6d756b4..1b8bb710 100644 --- a/man/mase.Rd +++ b/man/mase.Rd @@ -132,8 +132,8 @@ INTERMITTENT DEMAND. \emph{Foresight}, 4, 46. \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -143,14 +143,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/mpe.Rd b/man/mpe.Rd index a5f295fa..58d08d81 100644 --- a/man/mpe.Rd +++ b/man/mpe.Rd @@ -98,8 +98,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -109,14 +109,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/msd.Rd b/man/msd.Rd index adb120d9..45ecff40 100644 --- a/man/msd.Rd +++ b/man/msd.Rd @@ -97,8 +97,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -108,14 +108,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/poisson_log_loss.Rd b/man/poisson_log_loss.Rd index 5301310b..03306105 100644 --- a/man/poisson_log_loss.Rd +++ b/man/poisson_log_loss.Rd @@ -60,8 +60,8 @@ poisson_log_loss(count_results, count, pred) \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -71,14 +71,14 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/pr_curve.Rd b/man/pr_curve.Rd index 0771042c..cb216c96 100644 --- a/man/pr_curve.Rd +++ b/man/pr_curve.Rd @@ -100,6 +100,7 @@ data(two_class_example) # `"truth"`, it is the event of interest and we pass in probabilities for it. pr_curve(two_class_example, truth, Class1) +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # `autoplot()` @@ -127,7 +128,7 @@ hpc_cv \%>\% group_by(Resample) \%>\% pr_curve(obs, VF:L) \%>\% autoplot() - +\dontshow{\}) # examplesIf} } \seealso{ Compute the area under the precision recall curve with \code{\link[=pr_auc]{pr_auc()}}. diff --git a/man/rmse.Rd b/man/rmse.Rd index d62fb43f..ee8ef9b2 100644 --- a/man/rmse.Rd +++ b/man/rmse.Rd @@ -84,8 +84,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -95,14 +95,14 @@ Other numeric metrics: \code{\link{poisson_log_loss}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/roc_auc_survival.Rd b/man/roc_auc_survival.Rd index 5fdf594e..06fd4396 100644 --- a/man/roc_auc_survival.Rd +++ b/man/roc_auc_survival.Rd @@ -79,6 +79,7 @@ This method automatically groups by the \code{.eval_time} argument. Larger values of the score are associated with better model performance. } \examples{ +\dontshow{if (rlang::is_installed(c("tidyr"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(dplyr) lung_surv \%>\% @@ -86,6 +87,7 @@ lung_surv \%>\% truth = surv_obj, .pred ) +\dontshow{\}) # examplesIf} } \references{ Blanche, P., Dartigues, J.-F. and Jacqmin-Gadda, H. (2013), Review and @@ -100,8 +102,8 @@ and comparison of prognostic classification schemes for survival data. Compute the ROC survival curve with \code{\link[=roc_curve_survival]{roc_curve_survival()}}. Other dynamic survival metrics: -\code{\link{brier_survival_integrated}()}, -\code{\link{brier_survival}()} +\code{\link{brier_survival}()}, +\code{\link{brier_survival_integrated}()} } \author{ Emil Hvitfeldt diff --git a/man/roc_curve.Rd b/man/roc_curve.Rd index 3231a26f..fe27e188 100644 --- a/man/roc_curve.Rd +++ b/man/roc_curve.Rd @@ -109,6 +109,7 @@ data(two_class_example) # `"truth"`, it is the event of interest and we pass in probabilities for it. roc_curve(two_class_example, truth, Class1) +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} # --------------------------------------------------------------------------- # `autoplot()` @@ -140,7 +141,7 @@ hpc_cv \%>\% roc_curve(obs, VF:L) \%>\% autoplot() } - +\dontshow{\}) # examplesIf} } \seealso{ Compute the area under the ROC curve with \code{\link[=roc_auc]{roc_auc()}}. diff --git a/man/roc_curve_survival.Rd b/man/roc_curve_survival.Rd index 763377a3..3b5d5333 100644 --- a/man/roc_curve_survival.Rd +++ b/man/roc_curve_survival.Rd @@ -65,6 +65,7 @@ internal data set \code{lung_surv} shows an example of the format. This method automatically groups by the \code{.eval_time} argument. } \examples{ +\dontshow{if (rlang::is_installed(c("ggplot2"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} result <- roc_curve_survival( lung_surv, truth = surv_obj, @@ -91,6 +92,7 @@ result \%>\% # Or use autoplot autoplot(result) +\dontshow{\}) # examplesIf} } \references{ Blanche, P., Dartigues, J.-F. and Jacqmin-Gadda, H. (2013), Review and diff --git a/man/rpd.Rd b/man/rpd.Rd index 251ce5aa..2a4ff81d 100644 --- a/man/rpd.Rd +++ b/man/rpd.Rd @@ -114,8 +114,8 @@ The closely related inter-quartile metric: \code{\link[=rpiq]{rpiq()}} Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -125,15 +125,15 @@ Other numeric metrics: \code{\link{poisson_log_loss}()}, \code{\link{rmse}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other consistency metrics: \code{\link{ccc}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, -\code{\link{rsq}()} +\code{\link{rsq}()}, +\code{\link{rsq_trad}()} } \author{ Pierre Roudier diff --git a/man/rpiq.Rd b/man/rpiq.Rd index 987b67c1..ccd35e0a 100644 --- a/man/rpiq.Rd +++ b/man/rpiq.Rd @@ -114,8 +114,8 @@ The closely related deviation metric: \code{\link[=rpd]{rpd()}} Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -125,15 +125,15 @@ Other numeric metrics: \code{\link{poisson_log_loss}()}, \code{\link{rmse}()}, \code{\link{rpd}()}, -\code{\link{rsq_trad}()}, \code{\link{rsq}()}, +\code{\link{rsq_trad}()}, \code{\link{smape}()} Other consistency metrics: \code{\link{ccc}()}, \code{\link{rpd}()}, -\code{\link{rsq_trad}()}, -\code{\link{rsq}()} +\code{\link{rsq}()}, +\code{\link{rsq_trad}()} } \author{ Pierre Roudier diff --git a/man/rsq.Rd b/man/rsq.Rd index 1e88937b..19f421bd 100644 --- a/man/rsq.Rd +++ b/man/rsq.Rd @@ -118,8 +118,8 @@ American Statistician (1985) vol. 39 (4) pp. 279-285. \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/rsq_trad.Rd b/man/rsq_trad.Rd index 2cc7c9cb..1fe77abd 100644 --- a/man/rsq_trad.Rd +++ b/man/rsq_trad.Rd @@ -104,8 +104,8 @@ American Statistician (1985) vol. 39 (4) pp. 279-285. \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/smape.Rd b/man/smape.Rd index 313bec13..e08b969b 100644 --- a/man/smape.Rd +++ b/man/smape.Rd @@ -88,8 +88,8 @@ metric_results \%>\% \seealso{ Other numeric metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, @@ -100,13 +100,13 @@ Other numeric metrics: \code{\link{rmse}()}, \code{\link{rpd}()}, \code{\link{rpiq}()}, -\code{\link{rsq_trad}()}, -\code{\link{rsq}()} +\code{\link{rsq}()}, +\code{\link{rsq_trad}()} Other accuracy metrics: \code{\link{ccc}()}, -\code{\link{huber_loss_pseudo}()}, \code{\link{huber_loss}()}, +\code{\link{huber_loss_pseudo}()}, \code{\link{iic}()}, \code{\link{mae}()}, \code{\link{mape}()}, diff --git a/man/summary.conf_mat.Rd b/man/summary.conf_mat.Rd index 0c576133..8c83e161 100644 --- a/man/summary.conf_mat.Rd +++ b/man/summary.conf_mat.Rd @@ -58,6 +58,7 @@ the "one" level is always the relevant result. } \examples{ +\dontshow{if (rlang::is_installed(c("tidyr"))) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} data("two_class_example") cmat <- conf_mat(two_class_example, truth = "truth", estimate = "predicted") @@ -81,6 +82,7 @@ all_metrics \%>\% mean = mean(.estimate, na.rm = TRUE), sd = sd(.estimate, na.rm = TRUE) ) +\dontshow{\}) # examplesIf} } \seealso{ \code{\link[=conf_mat]{conf_mat()}} diff --git a/tests/testthat/test-aaa-metrics.R b/tests/testthat/test-aaa-metrics.R index 01f1d80d..bc461124 100644 --- a/tests/testthat/test-aaa-metrics.R +++ b/tests/testthat/test-aaa-metrics.R @@ -139,6 +139,7 @@ test_that("can mix class and class prob metrics together", { }) test_that("dynamic survival metric sets", { + skip_if_not_installed("tidyr") my_set <- metric_set(brier_survival) expect_equal( @@ -148,6 +149,7 @@ test_that("dynamic survival metric sets", { }) test_that("can mix dynamic and static survival metric together", { + skip_if_not_installed("tidyr") expect_no_error( mixed_set <- metric_set(brier_survival, concordance_survival) ) @@ -157,6 +159,8 @@ test_that("can mix dynamic and static survival metric together", { }) test_that("can mix dynamic and static survival metric together", { + skip_if_not_installed("tidyr") + expect_no_error( mixed_set <- metric_set( brier_survival, @@ -417,6 +421,8 @@ test_that("propagates 'caused by' error message when specifying the wrong column }) test_that("metric_tweak and metric_set plays nicely together (#351)", { + skip_if_not_installed("tidyr") + # Classification multi_ex <- data_three_by_three() diff --git a/tests/testthat/test-autoplot.R b/tests/testthat/test-autoplot.R index bd3ce9c0..286e6638 100644 --- a/tests/testthat/test-autoplot.R +++ b/tests/testthat/test-autoplot.R @@ -1,3 +1,5 @@ +skip_if_not_installed("ggplot2") + # As of R 3.6, cannot rely on old sample() results to be the same. # Pre R 3.6, they were generated like this, and we have saved them # as static values to be more reproducible diff --git a/tests/testthat/test-fair-aaa.R b/tests/testthat/test-fair-aaa.R index 2a84d6e5..72e153d7 100644 --- a/tests/testthat/test-fair-aaa.R +++ b/tests/testthat/test-fair-aaa.R @@ -38,6 +38,8 @@ test_that("basic functionality", { }) test_that("new_groupwise_metric() works with grouped input", { + skip_if_not_installed("tidyr") + data("hpc_cv") hpc_cv$group <- sample(c("a", "b"), nrow(hpc_cv), replace = TRUE) diff --git a/tests/testthat/test-surv-brier_survival.R b/tests/testthat/test-surv-brier_survival.R index 25b641cf..e24b1e20 100644 --- a/tests/testthat/test-surv-brier_survival.R +++ b/tests/testthat/test-surv-brier_survival.R @@ -1,4 +1,6 @@ test_that("case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() brier_res <- brier_survival( @@ -14,6 +16,8 @@ test_that("case weights", { }) test_that("case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$case_wts <- rep(2, nrow(lung_surv)) @@ -37,6 +41,8 @@ test_that("case weights", { }) test_that("works with hardhat case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$case_wts <- rep(2, nrow(lung_surv)) @@ -57,6 +63,8 @@ test_that("works with hardhat case weights", { # riskRegression compare ------------------------------------------------------- test_that("riskRegression equivalent", { + skip_if_not_installed("tidyr") + riskRegression_res <- readRDS(test_path("data/brier_churn_res.rds")) yardstick_res <- readRDS(test_path("data/tidy_churn.rds")) %>% diff --git a/tests/testthat/test-surv-brier_survival_integrated.R b/tests/testthat/test-surv-brier_survival_integrated.R index 564ae1ac..cf68c26b 100644 --- a/tests/testthat/test-surv-brier_survival_integrated.R +++ b/tests/testthat/test-surv-brier_survival_integrated.R @@ -1,4 +1,6 @@ test_that("brier_survival_integrated calculations", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() brier_res <- brier_survival( @@ -23,6 +25,8 @@ test_that("brier_survival_integrated calculations", { }) test_that("brier_survival_integrated calculations", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$.pred <- lapply(lung_surv$.pred, function(x) x[1, ]) @@ -38,6 +42,8 @@ test_that("brier_survival_integrated calculations", { }) test_that("case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$case_wts <- seq_len(nrow(lung_surv)) @@ -66,6 +72,8 @@ test_that("case weights", { test_that("works with hardhat case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$case_wts <- rep(2, nrow(lung_surv)) @@ -81,4 +89,4 @@ test_that("works with hardhat case weights", { expect_no_error( brier_survival_integrated(df, truth = surv_obj, .pred, case_weights = freq_wgt) ) -}) \ No newline at end of file +}) diff --git a/tests/testthat/test-surv-roc_auc_survival.R b/tests/testthat/test-surv-roc_auc_survival.R index e082b6a9..9a93cad4 100644 --- a/tests/testthat/test-surv-roc_auc_survival.R +++ b/tests/testthat/test-surv-roc_auc_survival.R @@ -1,4 +1,6 @@ test_that("roc_curve_auc() calculations", { + skip_if_not_installed("tidyr") + survival_curve <- roc_curve_survival( lung_surv, truth = surv_obj, @@ -24,6 +26,8 @@ test_that("roc_curve_auc() calculations", { # case weights ----------------------------------------------------------------- test_that("case weights are applied", { + skip_if_not_installed("tidyr") + wts_res <- lung_surv %>% dplyr::mutate(wts = hardhat::frequency_weights(rep(1:0, c(128, 100)))) %>% roc_auc_survival( @@ -43,6 +47,8 @@ test_that("case weights are applied", { }) test_that("works with hardhat case weights", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$case_wts <- rep(2, nrow(lung_surv)) @@ -63,6 +69,8 @@ test_that("works with hardhat case weights", { # self checking ---------------------------------------------------------------- test_that("snapshot equivalent", { + skip_if_not_installed("tidyr") + snapshot_res <- readRDS(test_path("data/ref_roc_auc_survival.rds")) yardstick_res <- readRDS(test_path("data/tidy_churn.rds")) %>% @@ -85,6 +93,8 @@ test_that("snapshot equivalent", { # riskRegression compare ------------------------------------------------------- test_that("riskRegression equivalent", { + skip_if_not_installed("tidyr") + riskRegression_res <- readRDS(test_path("data/auc_churn_res.rds")) yardstick_res <- readRDS(test_path("data/tidy_churn.rds")) %>% diff --git a/tests/testthat/test-surv-roc_curve_survival.R b/tests/testthat/test-surv-roc_curve_survival.R index 7f022723..d08427a8 100644 --- a/tests/testthat/test-surv-roc_curve_survival.R +++ b/tests/testthat/test-surv-roc_curve_survival.R @@ -1,4 +1,6 @@ test_that("roc_curve_survival works", { + skip_if_not_installed("tidyr") + result <- roc_curve_survival( lung_surv, truth = surv_obj, @@ -40,6 +42,8 @@ test_that("roc_curve_survival works", { # case weights ----------------------------------------------------------------- test_that("case weights are applied", { + skip_if_not_installed("tidyr") + wts_res <- lung_surv %>% dplyr::mutate(wts = hardhat::frequency_weights(rep(1:0, c(128, 100)))) %>% roc_curve_survival( @@ -61,6 +65,8 @@ test_that("case weights are applied", { # self checking ---------------------------------------------------------------- test_that("snapshot equivalent", { + skip_if_not_installed("tidyr") + snapshot_res <- readRDS(test_path("data/ref_roc_curve_survival.rds")) yardstick_res <- readRDS(test_path("data/tidy_churn.rds")) %>% @@ -93,6 +99,8 @@ test_that("snapshot equivalent", { # Manual checking -------------------------------------------------------------- test_that("hand calculated equivalent", { + skip_if_not_installed("tidyr") + my_eval_time <- 300 lung_surv0 <- lung_surv %>% @@ -107,28 +115,28 @@ test_that("hand calculated equivalent", { delta <- .extract_surv_status(data$surv_obj) event_time <- .extract_surv_time(data$surv_obj) res <- dplyr::tibble(.threshold = sort(unique(c(-Inf, data$.pred_survival, Inf)), decreasing = TRUE)) - + obs_time_le_time <- event_time <= data$.eval_time obs_time_gt_time <- event_time > data$.eval_time n <- nrow(data) - + sensitivity_denom <- sum(obs_time_le_time * delta * data$.weight_censored, na.rm = TRUE) - + data_df <- data.frame( le_time = obs_time_le_time, delta = delta, weight_censored = data$.weight_censored ) - + data_split <- vec_split(data_df, data$.pred_survival) data_split <- data_split$val[order(data_split$key)] - + sensitivity <- vapply( data_split, function(x) sum(x$le_time * x$delta * x$weight_censored, na.rm = TRUE), FUN.VALUE = numeric(1) ) - + sensitivity <- cumsum(sensitivity) sensitivity <- sensitivity / sensitivity_denom sensitivity <- dplyr::if_else(sensitivity > 1, 1, sensitivity) @@ -157,17 +165,17 @@ test_that("hand calculated equivalent", { event_time <- yardstick:::.extract_surv_time(data$surv_obj) res <- dplyr::tibble(.threshold = sort(unique(c(-Inf, data$.pred_survival, Inf)), decreasing = TRUE)) - + obs_time_gt_time <- event_time > data$.eval_time n <- nrow(data) - + specificity_denom <- sum(obs_time_gt_time * data$.weight_censored, na.rm = TRUE) - + data_df <- data.frame( ge_time = obs_time_gt_time, weight_censored = data$.weight_censored ) - + data_split <- vec_split(data_df, data$.pred_survival) data_split <- data_split$val[order(data_split$key)] diff --git a/tests/testthat/test-template.R b/tests/testthat/test-template.R index 8d4642d1..a3db85cc 100644 --- a/tests/testthat/test-template.R +++ b/tests/testthat/test-template.R @@ -1044,6 +1044,8 @@ test_that("curve_metric_summarizer() handles column name collisions", { ## dynamic_survival_metric_summarizer ----------------------------------------- test_that("dynamic_survival_metric_summarizer() works as expected", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() brier_survival_res <- dynamic_survival_metric_summarizer( @@ -1071,6 +1073,8 @@ test_that("dynamic_survival_metric_summarizer() works as expected", { }) test_that("dynamic_survival_metric_summarizer() works with grouped input", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$group <- rep(1:2, length.out = nrow(lung_surv)) @@ -1107,6 +1111,8 @@ test_that("dynamic_survival_metric_summarizer() works with grouped input", { }) test_that("dynamic_survival_metric_summarizer()'s na_rm argument works", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv[1:5, 3] <- NA @@ -1160,6 +1166,8 @@ test_that("dynamic_survival_metric_summarizer()'s na_rm argument works", { }) test_that("dynamic_survival_metric_summarizer()'s case_weights argument works", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$wts <- seq_len(nrow(lung_surv)) @@ -1189,6 +1197,8 @@ test_that("dynamic_survival_metric_summarizer()'s case_weights argument works", }) test_that("dynamic_survival_metric_summarizer()'s errors with bad input", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() brier_survival_res <- dynamic_survival_metric_summarizer( @@ -1236,6 +1246,8 @@ test_that("dynamic_survival_metric_summarizer()'s errors with bad input", { }) test_that("dynamic_survival_metric_summarizer() deals with characters in truth and estimate", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() brier_survival_res <- dynamic_survival_metric_summarizer( @@ -1263,6 +1275,8 @@ test_that("dynamic_survival_metric_summarizer() deals with characters in truth a }) test_that("dynamic_survival_metric_summarizer() handles column name collisions", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() new_lung_surv <- lung_surv @@ -1521,6 +1535,8 @@ test_that("static_survival_metric_summarizer() deals with characters in truth an ## curve_survival_metric_summarizer ----------------------------------------- test_that("curve_survival_metric_summarizer() works as expected", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() roc_curve_survival_res <- curve_survival_metric_summarizer( @@ -1546,6 +1562,8 @@ test_that("curve_survival_metric_summarizer() works as expected", { }) test_that("curve_survival_metric_summarizer() works with grouped input", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$group <- rep(1:2, length.out = nrow(lung_surv)) @@ -1577,6 +1595,8 @@ test_that("curve_survival_metric_summarizer() works with grouped input", { }) test_that("curve_survival_metric_summarizer()'s na_rm argument works", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv[1:5, 3] <- NA @@ -1623,6 +1643,8 @@ test_that("curve_survival_metric_summarizer()'s na_rm argument works", { }) test_that("curve_survival_metric_summarizer()'s case_weights argument works", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() lung_surv$wts <- seq_len(nrow(lung_surv)) @@ -1650,6 +1672,8 @@ test_that("curve_survival_metric_summarizer()'s case_weights argument works", { }) test_that("curve_survival_metric_summarizer()'s errors with bad input", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() roc_curve_survival_res <- curve_survival_metric_summarizer( @@ -1696,7 +1720,9 @@ test_that("curve_survival_metric_summarizer()'s errors with bad input", { ) }) -test_that("curve_survival_metric_summarizer() deals with characters in truth and estimate", { +test_that("curve_survival_metric_summarizer() deals with characters n truth and estimate", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() roc_curve_survival_res <- curve_survival_metric_summarizer( @@ -1722,6 +1748,8 @@ test_that("curve_survival_metric_summarizer() deals with characters in truth and }) test_that("curve_survival_metric_summarizer() handles column name collisions", { + skip_if_not_installed("tidyr") + lung_surv <- data_lung_surv() new_lung_surv <- lung_surv