comp_combine: Complete and combine age or length comps

View source: R/comp_combine.r

comp_combineR Documentation

Complete and combine age or length comps

Description

Complete and combine age or length comps

Usage

comp_combine(
  comp_list,
  FUN = function(x) {
     sum(x, na.rm = TRUE)
 },
  scale_rows = TRUE
)

Arguments

comp_list

list of composition matrices, where column names are bin values (e.g. length or age), and rows are unique observations (e.g. years)

FUN

function (unquoted name) to apply to analogous cells of comp matrices. Default is to sum values.

scale_rows

logical. Should rows of resulting matrix be scaled to sum to 1? Defaults to TRUE.

Author(s)

Nikolai Klibansky

Examples

## Not run: 
# Combine age comp matrices for Red Porgy
cm <- rdat_RedPorgy$comp.mats
cma <- cm[grepl("^acomp.*ob$",names(cm))]
comp_combine(cma)

## End(Not run)


nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.