R/print.local_fit.R

Defines functions print.local_fit

Documented in print.local_fit

#' @title Print method for an object of class \code{local_fit}
#' @description Prints the contents of an object of class \code{local_fit}
#' @usage \method{print}{local_fit}(x, ...)
#' @param x an object of class \code{local_fit}
#' @param ... not yet functional.
#' @author Leonardo Ramirez-Lopez
#' @keywords internal
#' @export

print.local_fit <- function(x, ...) {
  if (!x$method %in% c("pls", "wapls", "gpr")) {
    message("Method not recognized!")
  }

  if (x$method == "pls") {
    cat("Partial least squares (pls)")
    cat("\nNumber of factors:", x$pls_c)
  }

  if (x$method == "wapls") {
    cat("Weighted average partial least squares (wapls)")
    cat("\nMin. and max. number of factors: from", x$pls_c[["min_pls_c"]], "to", x$pls_c[["max_pls_c"]])
  }

  if (x$method == "gpr") {
    cat("Gaussian process with linear kernel/dot product (gpr)")
    cat("\nNoise:", x$noise_variance)
  }
}

Try the resemble package in your browser

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

resemble documentation built on Nov. 9, 2020, 5:08 p.m.