Learn R Programming

fishmethods (version 1.9-0)

growthTraject: Plot growth trajectories obtained from tagging data

Description

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

Usage

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, ...)

Arguments

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

Value

output
if returnvec = TRUE, coordinates of the line segments are returned. If returnlimits=TRUE, x and y limits for plot are returned

Details

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().

Examples

Run this code
 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))

Run the code above in your browser using DataLab