R/print.fars_density.R

Defines functions print.fars_density

Documented in print.fars_density

#' Print method for fars_density objects
#'
#' @description Displays a brief summary of the density estimation object produced by the \code{density()} or \code{nl_density()} function.
#'
#' @param x An object of class \code{fars_density}.
#' @param ... Additional arguments (ignored).
#'
#' @return The input object \code{x}, returned invisibly.
#' 
#' @method print fars_density
#' @export
print.fars_density <- function(x, ...) {
  cat("FARS Density\n")
  cat("====================\n")
  cat("Time observations  :", nrow(x$density), "\n")
  cat("Estimation points  :", ncol(x$density), "\n")
  cat("Random samples     :", ncol(x$distribution), "\n")
  cat("Support range      : [", min(x$x_vals), ",", max(x$x_vals), "]\n")
  cat("Optimization       :", x$optimization,"\n")
  invisible(x)
}

Try the FARS package in your browser

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

FARS documentation built on Aug. 8, 2025, 7:33 p.m.