R/g_dataframe.R

Defines functions as.data.frame.aucroc as.data.frame.mmpoints as.data.frame.smpoints as.data.frame.mspoints as.data.frame.sspoints as.data.frame.mmcurves as.data.frame.smcurves as.data.frame.mscurves as.data.frame.sscurves

Documented in as.data.frame.aucroc as.data.frame.mmcurves as.data.frame.mmpoints as.data.frame.mscurves as.data.frame.mspoints as.data.frame.smcurves as.data.frame.smpoints as.data.frame.sscurves as.data.frame.sspoints

#' @rdname as.data.frame
#' @export
as.data.frame.sscurves <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = TRUE, ...
  )

  .dataframe_common(x, raw_curves = arglist[["raw_curves"]], ...)
}

#' @rdname as.data.frame
#' @export
as.data.frame.mscurves <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = TRUE, ...
  )

  .dataframe_common(x, raw_curves = arglist[["raw_curves"]], ...)
}

#' @rdname as.data.frame
#' @export
as.data.frame.smcurves <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = raw_curves, ...
  )

  .dataframe_common(x, raw_curves = arglist[["raw_curves"]], ...)
}

#' @rdname as.data.frame
#' @export
as.data.frame.mmcurves <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = raw_curves, ...
  )

  .dataframe_common(x, raw_curves = arglist[["raw_curves"]], ...)
}

#' @rdname as.data.frame
#' @export
as.data.frame.sspoints <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = TRUE, ...
  )

  .dataframe_common(x,
    mode = "basic", raw_curves = arglist[["raw_curves"]],
    ...
  )
}

#' @rdname as.data.frame
#' @export
as.data.frame.mspoints <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = TRUE, ...
  )

  .dataframe_common(x,
    mode = "basic", raw_curves = arglist[["raw_curves"]],
    ...
  )
}

#' @rdname as.data.frame
#' @export
as.data.frame.smpoints <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = raw_curves, ...
  )

  .dataframe_common(x,
    mode = "basic", raw_curves = arglist[["raw_curves"]],
    ...
  )
}

#' @rdname as.data.frame
#' @export
as.data.frame.mmpoints <- function(x, row.names = NULL, optional = FALSE,
                                   raw_curves = NULL, ...) {
  arglist <- .get_dataframe_arglist(attr(x, "args"),
    def_raw_curves = raw_curves, ...
  )

  .dataframe_common(x,
    mode = "basic", raw_curves = arglist[["raw_curves"]],
    ...
  )
}

#' @rdname as.data.frame
#' @export
as.data.frame.aucroc <- function(x, row.names = NULL, optional = FALSE, ...) {
  x$uaucs
}
takayasaito/precrec documentation built on Oct. 19, 2023, 7:28 p.m.