R/print.MBPCA.R

#' Print of \code{\link{MBPCA}} objects
#'
#' @param x An object resulting from \code{\link{MBPCA}}.
#' @param ... further arguments passed to or from other methods.
#'
#' @seealso \code{\link{summary.MBPCA}}
#'
#' @examples
#' data(ham)
#' X=ham$X
#' block=ham$block
#' res.mbpca <- MBPCA(X,block, name.block=names(block))
#' print(res.mbpca)
#'
#' @export
#'
print.MBPCA =  function (x, ...)
{

  n <- nrow(x$call$X)
  p <- ncol(x$call$X)
  nam <- x$call$name.block
  K <- length(nam)
  pk <- x$call$size.block

  var.scal <- x$call$scale
  block.scal <- x$call$scale.block

  ncomp <- x$call$ncomp

  cat("\n")
  cat(paste("Number of observations: ", n), sep = " ")
  cat("\n")
  cat(paste("Total number of variables: ", p), sep = " ")
  cat("\n")
  cat(paste("Number of blocks of variables: ", K), sep = " ")
  cat("\n")
  cat("Block's Name (Nb variables): ")
  cat(paste(paste(nam,"(",pk,")",sep=""),",",sep=" "))
  cat("\n")
  cat("\n")
  cat("# Scaling options chosen")
  cat("\n")
  cat("All variables are centered by default")
  cat("\n")
  cat(paste("Individual variable scaling: ", var.scal), sep = " ")
  cat("\n")
  cat(paste("Block scaling : ", block.scal), sep = " ")
  cat("\n")
  cat("\n")
  cat(paste("For the",ncomp,"computed dimensions, outputs include:" ), sep = " ")
  cat("\n")
  cat("   - Global ($T.g) and block components ($Block$T.b),")
  cat("\n")
  cat("   - Global weights ($W.g) and block weigths ($Block$W.b),")
  cat("\n")
  cat("   - Cumulative explained variance ($cumexplained), explained variance ($cumexplained) and salience ($saliences) by block and by dimension (see summary.MBPCA). ")


}

Try the MBAnalysis package in your browser

Any scripts or data that you put into this service are public.

MBAnalysis documentation built on Aug. 8, 2025, 7:26 p.m.