View source: R/calc_age2length.R
calc_age2length | R Documentation |
Calculate length composition in 1 cm bins from Atlantis output (st)age data Uses numbers at age, plus weight at age, and weight-length relationships to generate size comps
calc_age2length(
structn,
resn,
nums,
biolprm,
fgs,
maxbin = 150,
CVlenage = 0.1,
remove.zeroes = TRUE
)
structn |
A |
resn |
A |
nums |
A |
biolprm |
A list of biological parameters available from the
|
fgs |
A data frame created by |
maxbin |
The upper length (cm) bin applied to all species sampled. The default
value is 150.
Optionally, a |
CVlenage |
The variability in length at age (same for all species)
The default value is 0.1.
Optionally, a |
remove.zeroes |
Logical asking whether to only return numbers at length for
combinations of species, age, box, depth, etc that have numbers>0.
The default value is |
A list
containing three data.frame
s, mulen (mean length at age),
muweight (mean weight at age), and natlength (numbers at length). natlength is in the
same format as other dataframes in the atlantisom package except has two additional
columns to include the length bin information.
Gavin Fay
Other calc functions:
calc_Z()
,
calc_avgwtstage2age()
,
calc_biomass_age()
,
calc_biomass_pool()
,
calc_pred_cons()
,
calc_pred_diet()
,
calc_stage2age()
,
calc_timestep2time()
## Not run:
directory <- system.file("extdata", "SETAS_Example", package = "atlantisom")
load(file.path(directory, "outputsrun_truth.RData"))
# WARNING: EXTREMELY LONG RUN TIME for all species at full model resolution!
# even one species has a long run time; this works but takes minutes to return
result$structn <- result$structn[result$structn$species == "Demersal_S_Fish",]
result$resn <- result$resn[result$resn$species == "Demersal_S_Fish",]
result$nums <- result$nums[result$nums$species == "Demersal_S_Fish",]
lenout <- calc_age2length(
structn=result$structn, resn=result$resn, nums=result$nums,
biolprm = result$biolprm, fgs = result$fgs,
CVlenage = 0.1, remove.zeroes=TRUE)
str(lenout)
rm(lenout)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.