Learn R Programming

⚠️There's a newer version (2.3.1) of this package.Take me there.

Generate interactive ROC plots from R using ggplot

Most ROC curve plots obscure the cutoff values and inhibit interpretation and comparison of multiple curves. This attempts to address those shortcomings by providing plotting and interactive tools. Functions are provided to generate an interactive ROC curve plot for web use, and print versions. An interactive Shiny application is also included.

Installation

This is the development version of the package. It can be installed from github with

remotes::install_github("sachsmc/plotROC")

Basic usage

See examples live here

Acknowledgements

This package would not be possible without the following:

Citation

Read the code snippet article at JSS!

Michael C. Sachs (2017). plotROC: A Tool for Plotting ROC Curves. Journal of Statistical Software, Code Snippets, 79(2), 1-19. doi:10.18637/jss.v079.c02

A BibTeX entry for LaTeX users is

@Article{sachs2017plotROC,
    title = {{plotROC}: A Tool for Plotting ROC Curves},
    author = {Michael C. Sachs},
    journal = {Journal of Statistical Software, Code Snippets},
    year = {2017},
    volume = {79},
    number = {2},
    pages = {1--19},
    doi = {10.18637/jss.v079.c02},
  }

License

The MIT License (MIT)

Copyright (c) 2022 Michael C Sachs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copy Link

Version

Install

install.packages('plotROC')

Monthly Downloads

2,750

Version

2.3.0

License

MIT + file LICENSE

Maintainer

Last Published

May 26th, 2022

Functions in plotROC (2.3.0)

roc_key

Key for ROC geom
plot_journal_roc

Plot an ROC curve for use in print
plot_interactive_roc

Generate a standalone html document displaying an interactive ROC curve
multi_ggroc

Plot multiple ROC curves
plotROC

Tools for plotting ROC Curves
style_roc

Add guides and annotations to a ROC plot
GeomRoc

Empirical Receiver Operating Characteristic Curve
verify_d

Check that D is suitable for using as binary disease status
shiny_plotROC

Start the plotROC Shiny app
StatRocci

Calculate confidence regions for the empirical ROC curve
StatRoc

Calculate the empirical Receiver Operating Characteristic curve
ggroc

Plot an ROC curve
melt_roc

Transform biomarkers stored as wide to long
export_interactive_roc

Generate svg code for an ROC curve object
calculate_roc

Calculate the Empirical ROC curve
direct_label

Add direct labels to a ROC plot
geom_rocci

Confidence regions for the ROC curve
calc_auc

Calculate the Area under the ROC curve
calculate_multi_roc

Calculate the Empirical ROC curves for multiple biomarkers
getD3

Reads included JavaScript functions and returns them as a string for pasting into a webpage