aggregate_within_sample: Aggregate stomach contents within sample

View source: R/aggregate_sample_id.R

aggregate_within_sampleR Documentation

Aggregate stomach contents within sample

Description

Stomach contents are aggregated and predator information are updated for samples with the same sample_id and one or more fish fish_id.

Usage

aggregate_within_sample(stom)

Arguments

stom

stomach contents data of class STOMobs.

Details

The stomach contents weight by prey and prey_size class are summed for for all samples within a sample_id and predator size class. Number of stomachs are similarly added to include all stomachs, however only the total number of stomachs n_tot is maintained. In the aggregated data, the variable fish_id becomes the value of predator size.

Size classes of both predators and preys must have been assigned ( put_size_class_on_predator and put_size_class_on_prey ) before aggregation can be made.

Value

stomach contents data of class STOMobs with aggregated stomach contents and number of stomachs, and updated predator information.

Examples

## Not run: aggregate_within_sample(ns)

MortenVinther/FishStomachs documentation built on Feb. 14, 2025, 7:33 a.m.