Learn R Programming

atlantistools (version 0.4.3)

combine_ages: Combine ageclasses to juvenile and adult stanza according to age at maturity.

Description

Combine ageclasses to juvenile and adult stanza according to age at maturity.

Usage

combine_ages(data, grp_col, agemat, value_col = "atoutput")

Arguments

data

Dataframe with ageclass specific information.

grp_col

Character string giving the name of the group column in data. E.g. 'species', 'pred', 'prey' etc.

agemat

First mature age class for age structured groups. This dataframe should be generated with prm_to_df using "age_mat" as parameter.

value_col

Character string giving the name of the column to sum. Default is "atoutput".

Value

Dataframe with ageclasses combined to stanzas.

Examples

Run this code
# NOT RUN {
d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools")
prm_biol <- file.path(d, "VMPA_setas_biol_fishing_Trunk.prm")
fgs <- file.path(d, "SETasGroupsDem_NoCep.csv")

agemat <- prm_to_df(prm_biol = prm_biol, fgs = fgs,
                    group = get_age_acronyms(fgs = fgs),
                    parameter = "age_mat")

combine_ages(ref_nums, grp_col = "species", agemat = agemat)
# }

Run the code above in your browser using DataLab