wide2long: Convert Wide Table to Long Format

View source: R/wide2long.R

wide2longR Documentation

Convert Wide Table to Long Format

Description

Convert a table from wide format to long format.

Usage

wide2long(x, names = c("Age", "Value"))

Arguments

x

a data frame in wide format.

names

a vector of two names for the last two columns of the resulting data frame.

Value

A data frame.

Note

TAF stores tables as data frames, usually with a year column as seen in stock assessment reports. Although year is the most common dimension, tables may also include area, sex, season, or other additional dimensions. The catage.wide table provides an example of a wide table that includes area and year as dimensions. The long format is more convenient for analysis and producing plots.

See Also

catage.taf and catage.wide describe the TAF and wide formats.

taf2long converts a TAF table to long format.

TAF-package gives an overview of the package.

Examples

wide2long(catage.wide, names=c("Age","Catch"))


TAF documentation built on Nov. 5, 2025, 7:21 p.m.