tseries_plot | R Documentation |
This is a simple plotting fucntion that is useful when plotting time series typically found in stock assessments (e.g. catch, indices)
tseries_plot(
x,
err,
errType = "sd",
errStyle = "bands",
errUnits = "SE",
nErrUnits = 2,
errLim = c(0, Inf),
plotLabel = NULL,
matplot_args = list(col = rainbow(ncol(x)), type = "o", lty = 1, lwd = 2, pch = 16,
ylim = NULL),
polygon_args = list(border = NA, lwd = matplot_args$lwd),
col_band_alpha = 0.3,
pt_buffer = 0.1,
...
)
x |
data frame of mean observations by year, where columns are different groups (e.g. fleets) |
err |
error values for each value in x. Must be same dimensions as x |
errType |
type of error provided: "cv"= coefficient of variation or "sd"=standard deviation. If "cv" then x is multiplied by err to compute sd. |
errStyle |
Style of displaying error around the central tendency time series x. Can be"bars" or "bands" |
errUnits |
Units of err. Used only for displaying text on plot (e.g. "SE") |
nErrUnits |
Multiplied by err to determine how far above and below x to to plot the errors |
errLim |
Range for limiting the plotting of error bars or bands. |
plotLabel |
character string for labeling plot |
matplot_args |
list of additional arguments passed to |
polygon_args |
list of additional arguments passed to |
col_band_alpha |
alpha (transparency) value between 0 and 1 to adjust opacity of color bands |
... |
pass additional arguments to matplot |
ylim |
range of y on plot |
Nikolai Klibansky
## Not run:
rdat <- rdat_BlackSeaBass
tser <- rdat$t.series
U <- tser[,grepl("^U.*ob$",names(tser))]
Ucv <- tser[,grepl("^cv.U.",names(tser))]
tseries_plot(U,Ucv,xlab="year",ylab="index of abundance",plotLabel=rdat$info$species)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.