diff --git a/DESCRIPTION b/DESCRIPTION index f66a29b..8baec69 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,33 +1,34 @@ Package: challengeR Type: Package Title: Analyzing assessment data of biomedical image analysis competitions and visualization of results Version: 0.3.3 Date: 2020-04-18 Author: Manuel Wiesenfarth, Annette Kopp-Schneider Maintainer: Manuel Wiesenfarth Description: Analyzing assessment data of biomedical image analysis competitions and visualization of results. License: GPL-3 Depends: R (>= 3.5.2), ggplot2 (>= 3.3.0), purrr (>= 0.3.3) Imports: dplyr (>= 0.8.5), graph (>= 1.64.0), knitr (>= 1.28), methods (>= 3.6.0), plyr (>= 1.8.6), relations (>= 0.6-9), reshape2 (>= 1.4.3), rlang (>= 0.4.5), rmarkdown (>= 2.1), tidyr (>= 1.0.2), viridisLite (>= 0.3.0) Suggests: doParallel (>= 1.0.15), foreach (>= 1.4.8), ggpubr (>= 0.2.5), Rgraphviz (>= 2.30.0), testthat (>= 2.1.0) VignetteBuilder: knitr +Roxygen: list(markdown = TRUE) RoxygenNote: 7.1.0 diff --git a/R/wrapper.R b/R/wrapper.R index bef8971..328a09e 100644 --- a/R/wrapper.R +++ b/R/wrapper.R @@ -1,84 +1,84 @@ #' Performs ranking via aggregate-then-rank #' #' Performs ranking by first aggregating performance values across all cases (e.g., with the mean, median or another quantile) for each algorithm. #' This aggregate is then used to compute a rank for each algorithm. #' #' @param object The challenge object. #' @param FUN The aggregation function, e.g. mean, median, min, max, function(x), quantile(x, probs=0.05). -#' @param ties.method A string specifying how ties are treated, see \code{\link{base::rank}}. +#' @param ties.method A string specifying how ties are treated, see [base::rank()]. #' @param ... Further arguments passed to or from other functions. #' #' @return An S3 object of class "ranked.list" to represent a ranked assessment data set. #' #' @examples #' #' \dontrun{ #' aggregateThenRank(challenge, FUN = mean, ties.method = "average", na.treat = 0) #' } #' #' @family ranking functions #' @export aggregateThenRank=function(object,FUN,ties.method = "min",...){ object %>% aggregate(FUN=FUN,...) %>% rank(ties.method = ties.method) } #' Performs ranking via test-then-rank #' #' Computes statistical hypothesis tests based on Wilcoxon signed rank test for each possible #' pair of algorithms to assess differences in metric values between the algorithms. #' Then ranking is performed according to the number of significant one-sided test results. #' If algorithms have the same number of significant test results, then they obtain the same rank. #' #' @param object The challenge object. -#' @param ties.method A string specifying how ties are treated, see \code{\link{base::rank}}. +#' @param ties.method A string specifying how ties are treated, see [base::rank()]. #' @param ... Further arguments passed to or from other functions. #' #' @return An S3 object of class "ranked.list" to represent a ranked assessment data set. #' #' @examples #' \dontrun{ #' testThenRank(challenge, #' alpha=0.05, # significance level #' p.adjust.method="none", # method for adjustment for multiple testing, see ?p.adjust #' na.treat = 0) #' } #' #' @family ranking functions #' @export testThenRank=function(object, ties.method = "min",...){ object %>% aggregate(FUN="significance",...) %>% rank(ties.method = ties.method) } #' Performs ranking via rank-then-aggregate #' -#' Performs ranking by first computing a rank for each case for each algorithm (”rank first”). +#' Performs ranking by first computing a rank for each case for each algorithm ("rank first"). #' The final rank is based on the aggregated ranks for the cases. This ranking method handles missing values implicitly #' by assigning the worst rank to missing algorithm performances. #' #' #' @param object The challenge object. #' @param FUN The aggregation function, e.g., mean, median, min, max, function(x), quantile(x, probs=0.05). -#' @param ties.method A string specifying how ties are treated, see \code{\link{base::rank}}. +#' @param ties.method A string specifying how ties are treated, see [base::rank()]. #' #' @return An S3 object of class "ranked.list" to represent a ranked assessment data set. #' #' @examples #' \dontrun{ #' rankThenAggregate(challenge, FUN = mean) #' } #' #' @family ranking functions #' @export rankThenAggregate=function(object, FUN, ties.method = "min" ){ object %>% rank(ties.method = ties.method)%>% aggregate(FUN=FUN) %>% rank(ties.method = ties.method) # small rank is always best, i.e. smallBetter always TRUE }