Skip to content

Commit

Permalink
Add an auc method for coords
Browse files Browse the repository at this point in the history
  • Loading branch information
xrobin committed Aug 11, 2024
1 parent 484e18a commit 0606174
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ S3method("ci.auc", "multiclass.roc")
S3method("ci.auc", "multiclass.auc")

export(coords)
S3method("coords", "auc")
S3method("coords", "roc")
S3method("coords", "smooth.roc")

Expand Down
8 changes: 8 additions & 0 deletions R/coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
coords <- function(...)
UseMethod("coords")


coords.auc <- function(auc,
...) {
roc <- attr(auc, "roc")
roc$auc <- auc
return(coords(roc))
}

coords.smooth.roc <- function(smooth.roc,
x,
input,
Expand Down
5 changes: 4 additions & 1 deletion man/coords.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\encoding{UTF-8}
\name{coords}
\alias{coords}
\alias{coords.auc}
\alias{coords.roc}
\alias{coords.smooth.roc}

Expand All @@ -13,6 +14,7 @@
}
\usage{
coords(...)
\S3method{coords}{auc}{auc, ...}
\S3method{coords}{roc}(roc, x, input="threshold", ret=c("threshold",
"specificity", "sensitivity"), ignore.partial.auc=FALSE,
as.list=FALSE, drop=TRUE, best.method=c("youden", "closest.topleft"),
Expand All @@ -26,7 +28,8 @@ transpose = FALSE, as.matrix=FALSE, ...)
\arguments{
\item{roc, smooth.roc}{a \dQuote{roc} object from the
\code{\link{roc}} function, or a \dQuote{smooth.roc} object from the
\code{\link[=smooth.roc]{smooth}} function.
\code{\link[=smooth.roc]{smooth}} function, or an \dQuote{auc} object
from the \code{\link{auc}} function.
}
\item{x}{
the coordinates to look for. Numeric (if so, their meaning is
Expand Down

0 comments on commit 0606174

Please sign in to comment.