Learn R Programming

TAF (version 4.3.0)

ddim: Data Dimensions

Description

Show the data dimensions of a table.

Usage

ddim(x, reduce = FALSE)

Value

Named vector showing the dimension names and number of levels.

Arguments

x

a data frame where the first columns are dimension variables and the last column is a measurement variable.

reduce

is whether to omit single-level dimensions.

Details

Dimension variables can include year, age, region, fleet, survey, or the like, generally an integer or string. The measurement variable can be catch, fishing mortality, maturity, weight, or the like, often a decimal.

x can also be an FLR table in FLQuant format.

See Also

unique is the base function to extract the levels of a dimension variable.

TAF-package gives an overview of the package.

Examples

Run this code
# Long table format, 8 years and 4 ages
ddim(catage.long)

# Some base R datasets
ddim(esoph[-5])
ddim(rev(warpbreaks))
ddim(rev(ToothGrowth))

Run the code above in your browser using DataLab