style_roc | R Documentation |
Adds a diagonal guideline, minor grid lines, and optionally direct labels to ggplot objects containing a geom_roc layer.
style_roc(
major.breaks = c(0, 0.1, 0.25, 0.5, 0.75, 0.9, 1),
minor.breaks = c(seq(0, 0.1, by = 0.01), seq(0.9, 1, by = 0.01)),
guide = TRUE,
xlab = "False positive fraction",
ylab = "True positive fraction",
theme = theme_bw
)
major.breaks |
vector of breakpoints for the major gridlines and axes |
minor.breaks |
vector of breakpoints for the minor gridlines and axes |
guide |
logical, if TRUE draws diagonal guideline |
xlab |
X-axis label |
ylab |
Y-axis label |
theme |
Theme function compatible with ggplot2 |
D.ex <- rbinom(50, 1, .5)
fakedata <- data.frame(M1 = rnorm(50, mean = D.ex),
D = D.ex)
ggplot(fakedata, aes(m = M1, d = D)) + geom_roc() + style_roc()
ggplot(fakedata, aes(m = M1, d = D)) + geom_roc() + style_roc(xlab = "1 - Specificity")
ggplot(fakedata, aes(m = M1, d = D)) + geom_roc() + style_roc(theme = theme_grey)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.