R/xtab2long.R

Defines functions xtab2long

Documented in xtab2long

#' Convert Crosstab Table to Long Format
#'
#' Convert a table from crosstab format to long format.
#'
#' @param x a data frame in crosstab format.
#' @param names a vector of three column names for the resulting data frame.
#'
#' @return A data frame with three columns.
#'
#' @seealso
#' \code{\link{catage.xtab}} and \code{\link{catage.long}} describe the crosstab
#' and long formats.
#'
#' \code{\link{xtab2taf}} and \code{\link{taf2long}} are the underlying
#' functions that perform the conversion.
#'
#' \code{\link{TAF-package}} gives an overview of the package.
#'
#' @examples
#' xtab2long(catage.xtab, names=c("Year","Age","Catch"))
#'
#' @export

xtab2long <- function(x, names=c("Year","Age","Value"))
{
  taf2long(xtab2taf(x), names=names)
}

Try the TAF package in your browser

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

TAF documentation built on March 31, 2023, 6:51 p.m.