AUColors: A diverging color palette for AUC (Area Under ROC Curve).

Description Usage Arguments Details Value Examples

Description

This function returns a palette suitable for a heatmap of AUC (area under the ROC or Receiver Operating Characteristic). The palette is appropriate for any scale with equal positive and negative ranges above and below a central value. For AUC, the central value is 0.5, and the min and max are 0. and 1. More positive values map to bluer colors, more negative values map to yellower colors.

Usage

1
AUColors(n = 10, invert = FALSE, reverse = FALSE)

Arguments

n

Number of levels in palette (number of bins). Default: n = 10. Given error of ~0.5, n = 10 is recommended. For a higher precision, use n = 20. If n is odd, the central bin (encompassing the central value) will be a shade of grey.

invert

If invert = TRUE palette edges will be dark, and center will be light. Else, center is dark and edges are light.

reverse

If reverse = TRUE left side colors (more negative values) will be blue and right side colors will be yellow. Else, left (more negative) is yellow and right (more positive) is blue.

Details

Palette characteristics:

Value

character vector. A vector of RGB colors specified as hex color codes (#RRGGBB).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
p <- AUColors()
p
colorbar(p)

# Sample AUC Heat Map
randommatrix <- matrix(runif(12*6),ncol=6)
nlevels <- 10
lattice::levelplot(randommatrix,
  at = seq(0,1,1/nlevels), # number of breaks
  col.regions = AUColors(), # color map
  aspect = "iso")

## inverted and reversed, with grey center bin:
p <- AUColors(n=21,invert=TRUE,reverse=TRUE)
colorbar(p)

allopole/datacolor documentation built on May 4, 2019, 6:39 p.m.