simLenFromAge: Simulate fish length from given ages.

Description Usage Arguments Details Value See Also Examples

View source: R/simLenFromAge.R

Description

Constructs simulated fish lengths from a set of given ages and parameters for a von Bertalanffy growth model supplied by the user.

Usage

1
simLenFromAge(ages, Linf, K, t0, sigma, additive = TRUE, digits = 0)

Arguments

ages

A vector containg ages of individual fish.

Linf

A numeric representing the asyptotic mean length (L_infinity) in the von Bertalanffy growth model.

K

A numeric representing the Brody growth coefficient (K) in the von Bertalanffy growth model.

t0

A numeric representing the time when the mean length is zero (t_0) in the von Bertalanffy growth model.

sigma

A numeric representing the standard deviation (i.e., individual error) around the von Bertalanffy growth model.

additive

A logical indicating whether the standard deviation is for the additive- (TRUE; default) or multiplicative-error version of the von Bertalanffy growth model.

digits

A numeric controlling the number of digits to which the length data should be rounded before returning.

Details

This simulation simulates fish lengths by first predicing the mean length-at-age given a fish's age using the von Bertalanffy growth model and then randomly selecting a length from a normal distribution given this mean length-at-age and the supplied value for sigma.

Value

A vector containing the simulated lengths for individual fish.

See Also

simAges, simLenSelectP, simLenSelectM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Load FSA package for Summarize()
require(FSA)

## set seed for repeatability
set.seed(5234734)

## Simulated individual ages (random)
#    see simAges functions
bg.ages <- simAges(N0=500,A=0.35)

## Simulated lengths, given the above ages
bg.lens <- simLenFromAge(bg.ages,228,0.206,0,8)

## Some summaries
df <- data.frame(age=bg.ages,len=bg.lens)
Summarize(len~age,data=df,digits=1)
plot(len~age,data=df,pch=16,col=rgb(0,0,0,0.1),xlab="Age",ylab="Length")

droglenc/FSAsim documentation built on Feb. 15, 2020, 11:20 p.m.