Learn R Programming

iCOBRA (version 1.0.2)

prepare_data_for_plot: Prepare data for plotting

Description

Prepare performance data provided in an COBRAPerformance object (obtained by calculate_performance) for plotting.

Usage

prepare_data_for_plot(cobraperf, keepmethods = NULL, incloverall = TRUE,
  colorscheme = "hue_pal", facetted = TRUE, incltruth = TRUE)

Arguments

cobraperf
An COBRAPerformance object.
keepmethods
A character vector consisting of methods to retain for plotting (these should be a subset of basemethods(cobraperf)), or NULL (indicating that all methods represented in cobraperf should be retained).
incloverall
A logical indicating whether the "overall" results should be included if the results are stratified by an annotation.
colorscheme
Either a character string giving the color palette to use to define colors for the different methods, or a character vector with colors to use. The available pre-defined palettes depend on the number of different methods to distinguish. The choices are: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] If the number of allowed methods is exceeded, the colorscheme defaults to hue_pal.
facetted
A logical indicating whether the results should be split into subpanels when stratified by an annotation (TRUE), or kept in the same panel but shown with different colors (FALSE).
incltruth
A logical indicating whether the truth should be included in Venn diagrams.

Value

  • An COBRAPlot object

Examples

Run this code
data(cobradata_example)
cobraperf <- calculate_performance(cobradata_example,
                                   binary_truth = "status",
                                   cont_truth = "none",
                                   aspects = c("fdrtpr", "fdrtprcurve",
                                               "tpr", "roc"),
                                   thrs = c(0.01, 0.05, 0.1), splv = "none")
cobraplot <- prepare_data_for_plot(cobraperf, keepmethods = NULL,
                                   colorscheme = "Dark2")

## User-specified colors
cobraplot2 <- prepare_data_for_plot(cobraperf, keepmethods = NULL,
                                   colorscheme = c("blue", "red", "green"))

Run the code above in your browser using DataLab