Skip to content
Snippets Groups Projects
Commit 880c7a6e authored by Nathalie Vialaneix's avatar Nathalie Vialaneix
Browse files

added a print method to SFCB

parent 166c7457
No related branches found
No related tags found
No related merge requests found
# Generated by roxygen2: do not edit by hand
S3method(print,SFCB)
S3method(print,SISIRres)
S3method(print,ridgeRes)
S3method(print,sparseRes)
S3method(project,sparseRes)
S3method(summary,SFCB)
S3method(summary,SISIRres)
S3method(summary,ridgeRes)
S3method(summary,sparseRes)
......
......@@ -204,3 +204,57 @@ sfcb <- function(X, Y, group.method = c("adjclust", "cclustofvar"),
return(out)
}
# Methods for SFCB-class ####
#' @title Print SFCB object
#' @name SFCB
#' @export
#' @aliases summary.SFCB
#' @aliases print.SFCB
#' @aliases SFCB-class
#' @description Print a summary of the result of \code{\link{sfcb}} (
#' \code{SFCB} object)
#' @param object a \code{SFCB} object
#' @param x a \code{SFCB} object
#' @param ... not used
#' @author {Victor Picheny, \email{victor.picheny@inrae.fr}\cr
#' Remi Servien, \email{remi.servien@inrae.fr}\cr
#' Nathalie Vialaneix, \email{nathalie.vialaneix@inrae.fr}}
#' @seealso \code{\link{sfcb}}
summary.SFCB <- function(object, ...) {
cat("\nCall:\n")
print(object$call)
cat("\nSFCB object with:\n")
lobj <- length(object$groups)
if (lobj == 1) {
cat(" -", length(unique(object$groups[[1]])), "interval(s)\n")
} else {
minl <- length(unique(object$groups[[1]]))
maxl <- length(unique(object$groups[[lobj]]))
cat(" -", minl, "-", maxl, "interval(s)\n")
}
if ("selected" %in% names(object)) {
if (lobj == 1) {
selected <- object$groups[[1]][object$selected[[1]]]
cat(" -", length(unique(selected)), "selected interval(s)\n")
} else {
selected <- mapply(function(a, b) a[b], object$groups, object$selected)
selected <- sapply(selected, function(x) length(unique(x)))
cat(" -", min(selected), "-", max(selected), "selected interval(s)\n")
}
}
cat(" -", nrow(object$mse) / lobj, "repeats\n")
cat(" - MSE ranging in [", min(object$mse$mse), ", ",
max(min(object$mse$mse)), "]\n", sep = "")
if ("computational.times" %in% names(object)) {
cat(" - computational time (total):", sum(out1$computational.times),
"(seconds)\n\n")
}
return(invisible(NULL))
}
#' @export
#' @rdname SFCB
print.SFCB <- function(x, ...) {
summary(x)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment