export_interactive_roc: Generate svg code for an ROC curve object

View source: R/interactive_roc.R

export_interactive_rocR Documentation

Generate svg code for an ROC curve object

Description

Takes a ggplot object that contains a GeomRoc layer and returns a string that contains html suitable for creating a standalone interactive ROC curve plot.

Usage

export_interactive_roc(
  ggroc_p,
  add.cis = TRUE,
  hide.points = FALSE,
  prefix = "a",
  width = 6,
  height = 6,
  omit.js = FALSE,
  style = style_roc(theme = theme_grey()),
  ...
)

Arguments

ggroc_p

A ggplot object with a GeomRoc layer and optionally a GeomRocci layer as returned by geom_roc and/or geom_rocci. It can be modified with annotations, themes, etc.

add.cis

Logical, if true, removes the current confidence interval layer (if present) and replaces it with a denser layer of confidence regions

hide.points

Logical, if true, hides points layer so that points with cutoff values are only visible when hovering. Recommended for plots containing more than 3 curves.

prefix

A string to assign to the objects within the svg. Enables unique identification by the javascript code

width, height

Width and height in inches of plot

omit.js

Logical. If true, omit inclusion of javascript source in output. Useful for documents with multiple interactive plots

style

A call to the function style_roc

...

Other arguments passed to geom_rocci when add.cis = TRUE

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.

Value

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


sachsmc/plotROC documentation built on Jan. 26, 2024, 6:10 a.m.