pROC

Display and analyze ROC curves in R

https://github.com/xrobin/proc

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 11 committers (9.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

bootstrapping covariance cran hypothesis-testing machine-learning plot plotting r r-package roc roc-curve variance

Keywords from Contributors

data-manipulation
Last synced: 6 months ago · JSON representation

Repository

Display and analyze ROC curves in R

Basic Info
Statistics
  • Stars: 127
  • Watchers: 7
  • Forks: 31
  • Open Issues: 16
  • Releases: 0
Topics
bootstrapping covariance cran hypothesis-testing machine-learning plot plotting r r-package roc roc-curve variance
Created over 14 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.md

R build status R build status AppVeyor build status Codecov coverage CRAN Version Downloads

pROC

An R package to display and analyze ROC curves.

For more information, see:

  1. Xavier Robin, Natacha Turck, Alexandre Hainard, et al. (2011) “pROC: an open-source package for R and S+ to analyze and compare ROC curves”. BMC Bioinformatics, 7, 77. DOI: 10.1186/1471-2105-12-77
  2. The official web page
  3. The CRAN page
  4. My blog
  5. The FAQ

Stable

The latest stable version is best installed from the CRAN:

install.packages("pROC")

Getting started

If you don't want to read the manual first, try the following:

Loading

R library(pROC) data(aSAH)

Basic ROC / AUC analysis

R roc(aSAH$outcome, aSAH$s100b) roc(outcome ~ s100b, aSAH)

Smoothing

R roc(outcome ~ s100b, aSAH, smooth=TRUE)

more options, CI and plotting

```R roc1 <- roc(aSAH$outcome, aSAH$s100b, percent=TRUE, # arguments for auc partial.auc=c(100, 90), partial.auc.correct=TRUE, partial.auc.focus="sens", # arguments for ci ci=TRUE, boot.n=100, ci.alpha=0.9, stratified=FALSE, # arguments for plot plot=TRUE, auc.polygon=TRUE, max.auc.polygon=TRUE, grid=TRUE, print.auc=TRUE, show.thres=TRUE)

# Add to an existing plot. Beware of 'percent' specification!
roc2 <- roc(aSAH$outcome, aSAH$wfns,
        plot=TRUE, add=TRUE, percent=roc1$percent)        

```

Coordinates of the curve

R coords(roc1, "best", ret=c("threshold", "specificity", "1-npv")) coords(roc2, "local maximas", ret=c("threshold", "sens", "spec", "ppv", "npv"))

Confidence intervals

```R

Of the AUC

ci(roc2)

Of the curve

sens.ci <- ci.se(roc1, specificities=seq(0, 100, 5)) plot(sens.ci, type="shape", col="lightblue") plot(sens.ci, type="bars")

need to re-add roc2 over the shape

plot(roc2, add=TRUE)

CI of thresholds

plot(ci.thresholds(roc2)) ```

Comparisons

```R # Test on the whole AUC roc.test(roc1, roc2, reuse.auc=FALSE)

# Test on a portion of the whole AUC
roc.test(roc1, roc2, reuse.auc=FALSE, partial.auc=c(100, 90),
         partial.auc.focus="se", partial.auc.correct=TRUE)

# With modified bootstrap parameters
roc.test(roc1, roc2, reuse.auc=FALSE, partial.auc=c(100, 90),
         partial.auc.correct=TRUE, boot.n=1000, boot.stratified=FALSE)

```

Sample size

```R # Two ROC curves power.roc.test(roc1, roc2, reuse.auc=FALSE) power.roc.test(roc1, roc2, power=0.9, reuse.auc=FALSE)

# One ROC curve
power.roc.test(auc=0.8, ncases=41, ncontrols=72)
power.roc.test(auc=0.8, power=0.9)
power.roc.test(auc=0.8, ncases=41, ncontrols=72, sig.level=0.01)
power.roc.test(ncases=41, ncontrols=72, power=0.9)

```

Getting Help

If you still can't find an answer, you can:

Development

Installing the development version

Download the source code from git, unzip it if necessary, and then type R CMD INSTALL pROC. Alternatively, you can use the devtools package by Hadley Wickham to automate the process (make sure you follow the full instructions to get started):

R if (! requireNamespace("devtools")) install.packages("devtools") devtools::install_github("xrobin/pROC@develop")

Check

To run all automated tests and R checks, including slow tests:

cd .. # Run from parent directory VERSION=$(grep Version pROC/DESCRIPTION | sed "s/.\+ //") R CMD build pROC RUN_SLOW_TESTS=true R CMD check pROC_$VERSION.tar.gz

Or from an R command prompt with devtools:

devtools::check()

Tests

To run automated tests only from an R command prompt:

run_slow_tests <- TRUE # Optional, include slow tests devtools::test()

vdiffr

The vdiffr package is used for visual tests of plots.

To run all the test cases (incl. slow ones) from the command line:

R run_slow_tests <- TRUE devtools::test() # Must run the new tests testthat::snapshot_review()

To run the checks upon R CMD check, set environment variable NOT_CRAN=1:

NOT_CRAN=1 RUN_SLOW_TESTS=true R CMD check pROC_$VERSION.tar.gz

AppVeyor Build Cache

By default, AppVeyor stores a build cache containing installed dependencies. Sometimes you want to clean the cache, for instance if a Graphics API versionmismatch occurs on R-devel, indicating that ggplot2 was built with a previous version of R. For this you need the AppVeyor API key to make a DELETE request:

R export APPVEYOR_TOKEN="<your-api-token>" curl -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" -X DELETE https://ci.appveyor.com/api/projects/xrobin/pROC/buildcache

Release steps

  1. Update Version and Date in DESCRIPTION
  2. Update version and date in NEWS
  3. Get new version to release: VERSION=$(grep Version pROC/DESCRIPTION | sed "s/.\+ //") && echo $VERSION
  4. Build & check package: R CMD build pROC && R CMD check --as-cran pROC_$VERSION.tar.gz
  5. Check with slow tests: NOT_CRAN=1 RUN_SLOW_TESTS=true R CMD check pROC_$VERSION.tar.gz
  6. Check with R-devel: rhub::check_for_cran()
  7. Check reverse dependencies: revdepcheck::revdep_check(num_workers=8, timeout = as.difftime(60, units = "mins"))
  8. Merge into master: git checkout master && git merge develop
  9. Create a tag on master: git tag v$VERSION && git push --tags
  10. Submit to CRAN

Owner

  • Name: Xavier Robin
  • Login: xrobin
  • Kind: user
  • Location: Basel, Switzerland
  • Company: Swiss Institute of Bioinformatics / University of Basel

GitHub Events

Total
  • Issues event: 5
  • Watch event: 6
  • Delete event: 1
  • Issue comment event: 22
  • Push event: 27
  • Pull request event: 10
  • Create event: 2
Last Year
  • Issues event: 5
  • Watch event: 6
  • Delete event: 1
  • Issue comment event: 22
  • Push event: 27
  • Pull request event: 10
  • Create event: 2

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 970
  • Total Committers: 11
  • Avg Commits per committer: 88.182
  • Development Distribution Score (DDS): 0.037
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Xavier Robin x****b@x****e 934
Zane Billings 3****s 16
Michael Chirico c****m@g****m 6
Matthias Doering m****g@m****e 5
Stefan Siegert s****t@g****e 2
Xavier x****r@u****) 2
Shyam Saladi s****i 1
Mkranj m****6@g****m 1
Kirill Sevastyanenko k****a@g****m 1
Dmytro S Lituiev d****v@g****m 1
Clemens Messerschmidt m****c 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 97
  • Total pull requests: 15
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 19 days
  • Total issue authors: 57
  • Total pull request authors: 6
  • Average comments per issue: 2.22
  • Average comments per pull request: 3.33
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 8
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 17 days
  • Issue authors: 4
  • Pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 1.5
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • xrobin (34)
  • MichaelChirico (4)
  • jarauh (2)
  • topepo (2)
  • AngCamp (2)
  • yurasmol (2)
  • greynes (1)
  • DavisVaughan (1)
  • oharari (1)
  • 814471489 (1)
  • benneely (1)
  • DylanGuo1101 (1)
  • coslovskym (1)
  • yuliaUU (1)
  • kingcrimsontianyu (1)
Pull Request Authors
  • MichaelChirico (13)
  • DSLituiev (1)
  • Mkranj (1)
  • messersc (1)
  • wzbillings (1)
  • matdoering (1)
Top Labels
Issue Labels
feature-request (24) bug (14) test (7) api-change (7) can't reproduce (4) doc (4) question (4) duplicate (3) speed (2) more-info-needed (1) refactor (1) wontfix (1)
Pull Request Labels

Packages

  • Total packages: 4
  • Total downloads:
    • cran 132,368 last-month
  • Total docker downloads: 33,773,741
  • Total dependent packages: 153
    (may contain duplicates)
  • Total dependent repositories: 597
    (may contain duplicates)
  • Total versions: 96
  • Total maintainers: 1
cran.r-project.org: pROC

Display and Analyze ROC Curves

  • Versions: 39
  • Dependent Packages: 144
  • Dependent Repositories: 579
  • Downloads: 132,368 Last month
  • Docker Downloads: 33,773,741
Rankings
Dependent repos count: 0.6%
Dependent packages count: 0.7%
Downloads: 0.8%
Forks count: 2.5%
Stargazers count: 3.6%
Average: 4.2%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
proxy.golang.org: github.com/xrobin/proc
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/xrobin/pROC
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 7 months ago
conda-forge.org: r-proc
  • Versions: 9
  • Dependent Packages: 9
  • Dependent Repositories: 18
Rankings
Dependent packages count: 6.5%
Dependent repos count: 8.4%
Average: 19.5%
Forks count: 30.7%
Stargazers count: 32.4%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.14 depends
  • Rcpp >= 0.11.1 imports
  • methods * imports
  • plyr * imports
  • MASS * suggests
  • doParallel * suggests
  • ggplot2 * suggests
  • logcondens * suggests
  • microbenchmark * suggests
  • tcltk * suggests
  • testthat * suggests
  • vdiffr * suggests
.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite