Learn R Programming

plotROC (version 1.3.3)

export_interactive_roc: Generate svg code for an ROC curve object

Description

Takes a ggplot object as returned by ggroc or multi_ggroc and returns a string that contains html suitable for creating a standalone interactive ROC curve plot.

Usage

export_interactive_roc(ggroc_p, cutoffs = NULL, font.size = "12px",
  prefix = "a", width = 6, height = 6, lty = NULL, color = NULL,
  lwd = NULL, legend = FALSE)

Arguments

ggroc_p
An object as returned by ggroc or multi_ggroc. It can be modified with annotations, themes, etc.
cutoffs
Optional vector or list of vectors to over-ride the default cutoff labels. Useful for rescaling or rounding.
font.size
Character string that determines font size of cutoff labels
prefix
A string to assign to the objects within the svg. Enables unique idenfication by the javascript code
width
Width in inches of plot
height
Height in inches of plot
lty
Optional vector of integers defining line types to apply to curves
color
Optional vector of color names to apply to curves
lwd
Line widths for curves
legend
Logical. If true plots a legend in bottom right corner of plot

Value

  • A character object containing the html necessary to plot the ROC curve in a web browser

Details

If you intend to include more than one of these objects in a single page, use a different prefix string for each one. To use this function in knitr, use the chunk options fig.keep='none' and results = 'asis', then cat() the resulting string to the output. See the vignette for examples. Older browsers (< IE7) are not supported.