Skip to content

Commit

Permalink
Avoid nesting donttest and dontrun
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludvig committed Jul 30, 2024
1 parent a127da3 commit 1b81246
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions R/plot_confusion_matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,12 @@
#' # Plot first confusion matrix in evaluate() output
#' plot_confusion_matrix(evaluation)
#'
#' # Add sum tiles
#' }
#' \dontrun{
#' # Add sum tiles
#' plot_confusion_matrix(evaluation, add_sums = TRUE)
#' }
#' \donttest{
#'
#' # Add labels to diagonal row and column percentages
#' # This example assumes "B" is the positive class
Expand Down Expand Up @@ -249,10 +251,12 @@
#' # Plot first confusion matrix in evaluate() output
#' plot_confusion_matrix(evaluation)
#'
#' # Add sum tiles
#' }
#' \dontrun{
#' # Add sum tiles
#' plot_confusion_matrix(evaluation, add_sums = TRUE)
#' }
#' \donttest{
#'
#' # Counts only
#' plot_confusion_matrix(
Expand All @@ -270,9 +274,10 @@
#' theme_fn = ggplot2::theme_light
#' )
#'
#' }
#' \dontrun{
#' # Change colors palette to custom gradient
#' # with a different gradient for sum tiles
#' \dontrun{
#' plot_confusion_matrix(
#' evaluation[["Confusion Matrix"]][[1]],
#' palette = list("low" = "#B1F9E8", "high" = "#239895"),
Expand All @@ -282,6 +287,7 @@
#' add_sums = TRUE
#' )
#' }
#' \donttest{
#'
#' # The output is a ggplot2 object
#' # that you can add layers to
Expand Down
12 changes: 9 additions & 3 deletions man/plot_confusion_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b81246

Please sign in to comment.