Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repos:
additional_dependencies:
- checkmate
- data.table
- mlr3
- ggplot2
- mlr3misc
- scales
Expand Down
7 changes: 7 additions & 0 deletions R/BenchmarkResult.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#' * `"prc"`: Precision recall curve. See `"roc"`.
#'
#' @param object ([mlr3::BenchmarkResult]).
#' @param custom_facet_order (`character()`)\cr
#' Vector specyfing a custom facet order. Only applies for `type = "boxplot"`.
#' @template param_type
#' @template param_measure
#' @param ... (`any`):
Expand Down Expand Up @@ -46,6 +48,7 @@
autoplot.BenchmarkResult = function(object, # nolint
type = "boxplot",
measure = NULL,
custom_facet_order = NULL,
...) {

assert_string(type)
Expand All @@ -62,6 +65,10 @@ autoplot.BenchmarkResult = function(object, # nolint

switch(type,
"boxplot" = {
if (!is.null(custom_facet_order)) {
checkmate::assert_character(custom_facet_order)
tab$task_id = factor(tab$task_id, levels = custom_facet_order, ordered = TRUE)
}
ggplot(tab, mapping = aes(x = .data$nr, y = .data[[measure_id]])) +
geom_boxplot(...) +
labs(x = "") +
Expand Down
11 changes: 10 additions & 1 deletion man/autoplot.BenchmarkResult.Rd

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