Commit 91d8c3cd authored by fvafrcu's avatar fvafrcu

import/export

parent 44d28be3
Pipeline #101473640 passed with stages
in 14 minutes and 15 seconds
......@@ -2,3 +2,7 @@
export(bincap)
export(multcap)
exportClasses(bincap)
exportClasses(cap)
exportClasses(multcap)
exportMethods(auc)
......@@ -10,6 +10,7 @@
#' @author Andreas Dominik Cullmann
#' @seealso \code{"\link[=bincap-class]{class?bincap}"},
#' \code{"\link[=multcap-class]{class?multcap}"}
#' @export
#' @keywords classes
setClass(Class = "cap"
, representation = representation(
......@@ -44,6 +45,7 @@ setClass(Class = "cap"
#' \code{"\link[=multcap-class]{class?multcap}"} ,
#' \code{"\link[=bincap]{?bincap}"}
#' @keywords classes
#' @export
#' @examples
#'
#' showClass("bincap")
......@@ -84,6 +86,7 @@ setClass(Class = "bincap"
#' \code{"\link[=bincap-class]{class?bincap}"} ,
#' \code{"\link[=multcap]{?multcap}"}
#' @keywords classes
#' @export
#' @examples
#'
#' showClass("multcap")
......
......@@ -29,7 +29,7 @@
bincap <-
function (response, predicted, true = "1")
{
return(new(Class = "bincap", response = response, predicted = predicted,
return(methods::new(Class = "bincap", response = response, predicted = predicted,
true = true))
}
......
......@@ -6,6 +6,7 @@
#' Depending on whether \code{object} is of class \code{"bincap"} or of class
#' \code{"multcap"}, a two class or multiple class AUC is calculated.
#'
#' @param object An object of \code{class} \emph{bincap} or \emph{multcap}.
#' @name auc-methods
#' @aliases auc-methods auc auc,bincap-method auc,multcap-method
#' @docType methods
......@@ -26,6 +27,7 @@
#' DOI:
#' \href{http://dx.doi.org/10.1023/A:1010920819831}{10.1023/A:1010920819831}}.
#' @keywords methods auc
#' @export
#' @examples
#'
#' library(HandTill2001)
......@@ -74,7 +76,7 @@ setMethod(f = "auc"
, signature(object = "multcap")
, function(object){
return(mean(
combn(levels(object@response), 2,
utils::combn(levels(object@response), 2,
function(levels
, response
, predicted){
......@@ -82,13 +84,13 @@ setMethod(f = "auc"
df$obs <- response
dfs <- subset(df, get("obs") %in% levels)
t <- levels[1]
aij <- auc(new("bincap"
aij <- auc(methods::new("bincap"
, response = factor(dfs[,"obs"]) ## to drop non-ocurring levels
, predicted = dfs[,t]
, true = t)
)
t <- levels[2]
aji <- auc(new("bincap"
aji <- auc(methods::new("bincap"
, response = factor(dfs[,"obs"]) ## to drop non-ocurring levels
, predicted = dfs[,t]
, true = t)
......
......@@ -10,6 +10,9 @@
\usage{
\S4method{auc}{bincap}(object)
}
\arguments{
\item{object}{An object of \code{class} \emph{bincap} or \emph{multcap}.}
}
\value{
An object of class \code{"numeric"}.
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment