ccyear | R Documentation |
ccyear plots a histogram of either ages or lengths for each year available. It assumes the data are available as counts in columns, one for each age/length class with a row for each year. These can be plotted as frequencies or proportions, with flexibility in colouring, column widths, and other details of the plots.
ccyear(
x,
yrs,
comps,
freq = TRUE,
varlabel = NA,
width = 0.9,
col = 2,
border = 2,
lwd = 1,
xmin = NA,
xmax = NA,
inc = 1,
xaxis = TRUE,
vline = 0,
title = ""
)
x |
a matrix of years (rows) by counts (cols) |
yrs |
the labels for each row of x |
comps |
the ages or lengths to be plotted on the x-axis |
freq |
plot numbers 'freq' or proportions; default = TRUE |
varlabel |
what label to use on x-axis, default = NA |
width |
the width of each column in the histogram, default = 0.8 |
col |
colour of each cell; defaults to 2 (red) |
border |
colour of the border of each cell, default = 2 (red) |
lwd |
the width of the line around each polygon, default = 1 |
xmin |
starting value for xaxis, default = NA, so input range used |
xmax |
end value for xaxis, default = NA, so input range used |
inc |
the steps along xaxis, default = 1 |
xaxis |
if FALSE then a custom xaxis is plotted, default is TRUE |
vline |
optionally plot a vertical on each plot, default = 0 = no line |
title |
is literally a title for the plot. defaults to "" |
currently it returns nothing although it does generate a plot.
## Not run:
indat <- c(95,2898,3017,1159,591,116,100,82,33,77,606,4385,1186,231,
138,42,21,51,50,489,1121,4738,456,106,80,27,18)
naa <- matrix(indat,nrow=3,ncol=9,byrow=TRUE)
yrs <- c(1931,1932,1933)
ages <- 2:10
plotprep()
ccyear(naa,yrs,ages,plots=c(2,2),freq=TRUE,border=3,title="Example")
## End(Not run) # x=naa;yrs=yrs;comps=ages;freq=TRUE;border=3
# varlabel=NA;width=0.9;col=2;lwd=1;xmin=NA;xmax=NA;inc=1;xaxis=TRUE;vline=0
title="Example"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.