Browse code

- Provide a convenience S4 method for ClassifyResult input object for ROCplot, so that users don't need to put their result into a list, like performancePlot, rankingPlot, selectionPlot already provide.

Dario Strbenac authored on 13/09/2022 02:00:04
Showing 5 changed files

... ...
@@ -76,6 +76,12 @@
76 76
 #' @export
77 77
 setGeneric("ROCplot", function(results, ...) standardGeneric("ROCplot"))
78 78
 
79
+#' @rdname ROCplot
80
+#' @export
81
+setMethod("ROCplot", "ClassifyResult", function(results, ...) {
82
+    ROCplot(list(assay = results), ...)
83
+})
84
+
79 85
 #' @rdname ROCplot
80 86
 #' @export
81 87
 setMethod("ROCplot", "list", 
... ...
@@ -17,8 +17,7 @@
17 17
 #' design to compare. Can be any characteristic that all results share.
18 18
 #' @param metric Default: "Sample Error". The sample-wise metric to plot.
19 19
 #' @param featureValues If not NULL, can be a named factor or named numeric
20
-#' vector specifying some variable of interest to plot above the
21
-#' heatmap.
20
+#' vector specifying some variable of interest to plot above the heatmap.
22 21
 #' @param featureName A label describing the information in
23 22
 #' \code{featureValues}. It must be specified if \code{featureValues} is.
24 23
 #' @param metricColours If the outcome is categorical, a list of vectors of colours
... ...
@@ -3,8 +3,11 @@
3 3
 \name{ROCplot}
4 4
 \alias{ROCplot}
5 5
 \alias{ROCplot,list-method}
6
+\alias{ROCplot,ClassifyResult-method}
6 7
 \title{Plot Receiver Operating Curve Graphs for Classification Results}
7 8
 \usage{
9
+\S4method{ROCplot}{ClassifyResult}(results, ...)
10
+
8 11
 \S4method{ROCplot}{list}(
9 12
   results,
10 13
   mode = c("merge", "average"),
... ...
@@ -21,7 +21,7 @@ A function to perform fast cox proportional hazard model tests
21 21
 }
22 22
 \examples{
23 23
 data(asthma)
24
-time <- ppois(nrow(measurements),100)
24
+time <- rpois(nrow(measurements),100)
25 25
 status <- sample(c(0,1), nrow(measurements), replace = TRUE)
26 26
 x = measurements
27 27
 y = cbind(time, status)
... ...
@@ -61,8 +61,7 @@ design to compare. Can be any characteristic that all results share.}
61 61
 \item{metric}{Default: "Sample Error". The sample-wise metric to plot.}
62 62
 
63 63
 \item{featureValues}{If not NULL, can be a named factor or named numeric
64
-vector specifying some variable of interest to plot underneath the above the
65
-heatmap.}
64
+vector specifying some variable of interest to plot above the heatmap.}
66 65
 
67 66
 \item{featureName}{A label describing the information in
68 67
 \code{featureValues}. It must be specified if \code{featureValues} is.}