View source: R/geom_polygon_auc.R
geom_polygon_auc | R Documentation |
EXPERIMENTAL - Add an AUC polygon to a ggroc plot.
## S3 method for class 'auc'
geom_polygon_auc(data, legacy.axes = FALSE, ...)
## S3 method for class 'roc'
geom_polygon_auc(data, ...)
## S3 method for class 'smooth.roc'
geom_polygon_auc(data, ...)
data |
a roc object from the roc function, same as the one used to build the ggroc initially. |
legacy.axes |
must match the value given to |
... |
additional aesthetics for |
This is highly experimental and may change in the future.
ggroc
# Create a ROC curve:
data(aSAH)
roc.s100b <- roc(aSAH$outcome, aSAH$s100b)
roc.s100b.percent <- roc(aSAH$outcome, aSAH$s100b, percent = TRUE)
ggroc(roc.s100b) + geom_polygon_auc(roc.s100b$auc)
# legacy.axes must be repeated
ggroc(roc.s100b.percent, legacy.axes=TRUE) + geom_polygon_auc(roc.s100b.percent, legacy.axes=TRUE)
# Partial AUCs
auc.s100b.partial.sp <- auc(roc.s100b, partial.auc = c(0.9, 1))
auc.s100b.partial.se <- auc(roc.s100b, partial.auc = c(0.8, 0.9), partial.auc.focus="se")
ggroc(roc.s100b) + geom_polygon_auc(auc.s100b.partial.sp)
ggroc(roc.s100b) + geom_polygon_auc(auc.s100b.partial.se)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.