View source: R/growthTraject.R
growthTraject | R Documentation |
Age and length coordinates for the time of tagging and time of recapture are plotted as line segments overlayed on the von Bertalannfy growth curve
growthTraject(K, Linf, dat, lentag, lenrec, timelib, subsets=NULL,
main = "Growth trajectories & fitted curve",
cex.lab=1.5, cex.axis=1.5, cex.main=1,
xlab="Relative age, yr", ylab="Length, cm",
xlim=NULL, ylim=NULL,ltytraject=1, lwdtraject=1,
coltraject=1, ltyvonB=1, lwdvonB=2, colvonB="red",
returnvec=FALSE, returnlimits=FALSE, warn=TRUE, ...)
K |
parameter of the von Bertalanffy growth equation |
Linf |
parameter of the von Bertalanffy growth equation |
dat |
dataframe containing length at tagging, length at recapture and time at liberty. These must be named lentag, lenrec and timelib or else column 1 must contain the length at tagging, column 2 must contain length at recapture and column 3 must contain time at liberty OR the variables must be named lentag, lenrec and timelib |
lentag |
alternative way to pass data to function |
lenrec |
alternative way to pass data to function |
timelib |
alternative way to pass data to function |
subsets |
factor or integer variable specifying subsets of the data to be plotted with separate colors or line types |
main |
an overall title for the plot |
cex.lab |
The magnification to be used for x and y labels relative to the current setting of cex |
cex.axis |
The magnification to be used for axis annotation relative to the current setting of cex |
cex.main |
The magnification to be used for main titles relative to the current setting of cex |
xlab |
a title for the x axis |
ylab |
a title for the y axis |
xlim |
lower and upper limits of x axis e.g., c(0,100) |
ylim |
lower and upper limits of y axis e.g., c(0,100) |
ltytraject |
line type for the growth trajectories |
lwdtraject |
line width for the growth trajectories |
coltraject |
line color for the growth trajectories |
ltyvonB |
line type for the fitted von Bertalanffy growth curve |
lwdvonB |
line width for the fitted von Bertalanffy growth curve |
colvonB |
line color for the fitted von B. curve |
returnvec |
logical for whether the coordinates of the line segments should be returned) |
returnlimits |
logical for whether the x-axis and y-axis limits should be returned |
warn |
logical - if TRUE, function issues a warning if names of variables in dat do not match the 3 names expected. |
... |
other arguments to pass to plot |
The relative age at tagging is computed from the inverted von Bertalannfy growth equation (i.e., age expressed as a function of length); the age at recapture is taken to be the age at tagging plus the time at liberty. Then the (age, length) coordinates for the time of tagging and time of recapture are plotted as a line segment. Additional parameters control the format of the plot as follows. A call to plot() sets up the axes. Then a call to arrows() draws the line segments. Finally, a call to curve() adds the von Bertalanffy growth curve. Specifying additional graphical parameters is permissable but these will be passed only to plot().
output |
if returnvec = TRUE, coordinates of the line segments are returned. If returnlimits=TRUE, x and y limits for plot are returned |
Janos Hoenig Virginia Institute of Marine Science May 2013 hoenig@vims.edu
data(bonito)
temp<-bonito[c(bonito$T2-bonito$T1)>0,]
growthTraject(0.19,97.5,lentag=temp$L1, lenrec=temp$L2,timelib=c(temp$T2-temp$T1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.