% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/age.at.size.R
\name{age.at.size}
\alias{age.at.size}
\title{Age at size}
\usage{
age.at.size(A, k, size, size0, model)
}
\arguments{
\item{A}{(numeric) Asymptotic body size (can be calculated in \code{calc.growth()})}

\item{k}{(numeric) Growth rate (can be calculated in \code{calc.growth()})}

\item{size}{(numeric vector) The size(s) for which you want to know the age (should be in the same units used to calculate A and k)}

\item{size0}{(numeric) Initial body size at birth/hatching (should be in the same units used to calculate A and k). This will generally be a species average, rather than being specific per individual, but it can be a vector of specific birth/hatching sizes per individual if known.}

\item{model}{(character) The model used to calculate A and k. One of "vb", "gompertz","logistic".}
}
\value{
Vector of expected age(s)
}
\description{
Calculate expected age at a given size
}
\details{
It takes a vector of sizes, initial size for the species, and A and k from \code{calc.growth()} and returns the expected age at a given size based on the specified model.

\strong{Note}: Age cannot be calculated for sizes >A, resulting in NaN.
}
\examples{
#For this example, assume size is in mm and time is in years
#Use the gompertz formula to calculate the expected age of a 350 mm
#turtle for a species that hatches at an average size of 50 mm
age.at.size(A = 396.6738,
 k = 0.2029850,
 size = 350,
 size0 = 50,
 model="gompertz")

}
