plotCL: Plot Catch at Length

Description Usage Arguments Value Note See Also Examples

View source: R/plotCL.R

Description

Plot scape model fit to catch-at-length data.

Usage

1
2
3
4
5
6
7
8
plotCL(model, what="c", fit=TRUE, swap=FALSE, series=NULL, sex=NULL,
       years=NULL, lengths=NULL, axes=TRUE, same.limits=TRUE, log=FALSE,
       base=10, eps.log=1e-5, main="", xlab="", ylab="", cex.main=1.2,
       cex.lab=1, cex.axis=0.8, cex.strip=0.8, col.strip="gray95",
       strip=strip.custom(bg=col.strip), las=!fit, tck=c(1,fit)/2,
       tick.number=5, lty.grid=3, col.grid="gray", pch=16,
       cex.points=0.5, col.points="black", lty.lines=1, lwd.lines=2,
       col.lines=c("red","blue"), plot=TRUE, ...)

Arguments

model

fitted scape model containing element CLc and/or CLs.

what

what to plot: "c"[ommercial] or "s"[urvey] catch at length.

fit

whether to overlay fitted values on observed data.

swap

whether to swap lengths and years between axes or panels.

series

string indicating which gear or survey to plot (first by default).

sex

string indicating which sex to plot (both by default).

years

vector of numbers indicating which years to plot plot (all by default).

lengths

vector of numbers indicating which lengths to plot (all by default).

axes

whether to plot axis values.

same.limits

whether panels should have same y-axis limits.

log

whether to log-transform values.

base

logarithm base.

eps.log

small number to add before log-transforming to avoid log 0.

main

main title.

xlab

x-axis label.

ylab

y-axis label.

cex.main

size of main title.

cex.lab

size of axis labels.

cex.axis

size of tick labels.

cex.strip

size of strip labels.

col.strip

color of strip labels.

strip

logical flag (whether to plot strip labels), or a function passed to xyplot.

las

orientation of tick labels: 0=parallel, 1=horizontal, 2=perpendicular, 3=vertical.

tck

tick mark length.

tick.number

number of tick marks.

lty.grid

line type of gridlines.

col.grid

color of gridlines.

pch

symbol for points.

cex.points

size of points.

col.points

color of points.

lty.lines

line type of main lines, possibly a vector where element 2 refers to males.

lwd.lines

line width of main lines, possibly a vector where element 2 refers to males.

col.lines

color of main lines, possibly a vector where element 2 refers to males.

plot

whether to draw plot.

...

passed to xyplot, panel.xyplot, panel.superpose, and panel.superpose.2.

Value

When plot=TRUE, a trellis plot is drawn and a data frame is returned, containing the data used for plotting. When plot=FALSE, a trellis object is returned.

Note

The Args function from the gdata package is recommended for reviewing the arguments, instead of args.

See Also

xyplot, panel.xyplot, and panel.superpose are the underlying drawing functions.

plotCA, plotCL, plotIndex, and plotLA plot model fit and data.

plotB, plotN, and plotSel plot derived quantities.

scape-package gives an overview of the package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plotCL(x.ling, fit=FALSE, strip=FALSE, series="1", sex="Female",
       xlab="Length (cm)", ylab="Year")

plotCL(x.oreo, xlab="Length (cm)", ylab="Proportion in catch")

plotCL(x.oreo, "s", layout=c(2,1), xlab="Length (cm)",
       ylab="Observed proportion in survey", cex.points=0.8,
       col.points=c("red","blue"), lty.lines=0)

plotCL(x.ling, fit=FALSE, series="2", xlab="Length (cm)",
       ylab="Observed proportion in trawl catch", tck=0.5)

plotCL(x.ling, series="2", swap=TRUE, lengths=70:150, lty.grid=0)

Example output



scape documentation built on Nov. 23, 2020, 5:08 p.m.