Learn R Programming

iCOBRA (version 1.0.2)

reorder_levels: Reorder levels in COBRAPlot object

Description

Reorder levels in COBRAPlot object to achieve desired ordering in figure legends etc. If facetted(cobraplot) is TRUE, the releveling will be applied to the "method" column. If facetted(cobraplot) is FALSE, it will be applied to the "fullmethod" column.

Usage

reorder_levels(cobraplot, levels)

Arguments

cobraplot
A COBRAPlot object
levels
A character vector giving the order of the levels. Any values not present in the COBRAPlot object will be removed. Any methods present in the COBRAPlot object but not contained in this vector will be added at the end.

Value

  • A COBRAPlot object

Examples

Run this code
data(cobradata_example)
cobraperf <- calculate_performance(cobradata_example,
                                   binary_truth = "status", aspects = "fpr")
cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2",
                                   incltruth = TRUE)
cobraplot <- reorder_levels(cobraplot, c("voom", "edgeR"))
plot_fpr(cobraplot, xaxisrange = c(0, 0.25))

Run the code above in your browser using DataLab