R/LengthAtAge.R

#' LengthAtAge
#'
#' @param Ages
#' @param Fish
#' @param Error
#'
#' @return Vector of length at age
#' @export
LengthAtAge<- function(Ages,Fish,Error)
{

  LenSD<- Error*(1+Fish$VBErrorSlope*Ages/Fish$MaxAge)

  RawLengths<- Fish$Linf*(1-exp(-Fish$vbk*(Ages-Fish$t0)))

  LengthWithError<- RawLengths*rlnorm(length(Ages),mean=0,sd=LenSD)

  return(LengthWithError)
}
DanOvando/DLSA documentation built on May 6, 2019, 1:21 p.m.