Description Usage Arguments Author(s) See Also

View source: R/make_multifig.R

Function created as an alternative to lattice package for multi-figure plots of composition data and fits from Stock Synthesis output.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
make_multifig(ptsx, ptsy, yr, linesx = 0, linesy = 0, ptsSD = 0,
sampsize = 0, effN = 0, showsampsize = TRUE, showeffN = TRUE,
sampsizeround = 1, maxrows = 6, maxcols = 6, rows = 1, cols = 1,
fixdims = TRUE, main = "", cex.main = 1, xlab = "", ylab = "",
size = 1, cexZ1 = 1.5, bublegend = TRUE, maxsize = NULL,
do.sqrt = TRUE, minnbubble = 8, allopen = TRUE, horiz_lab = "default",
xbuffer = c(0.1, 0.1), ybuffer = c(0, 0.15), yupper = NULL,
ymin0 = TRUE, axis1 = NULL, axis2 = NULL, linepos = 1, type = "o",
polygons = TRUE, bars = FALSE, barwidth = "default", ptscex = 1,
ptscol = 1, ptscol2 = 1, colvec = c(rgb(1, 0, 0, 0.7), rgb(0, 0, 1,
0.7), rgb(0.1, 0.1, 0.1, 0.7)), linescol = c(rgb(0, 0.8, 0, 0.7), rgb(1, 0,
0, 0.7), rgb(0, 0, 1, 0.7)), lty = 1, lwd = 2, pch = 1, nlegends = 3,
legtext = list("yr", "sampsize", "effN"), legx = "default",
legy = "default", legadjx = "default", legadjy = "default",
legsize = c(1.2, 1), legfont = c(2, 1), venusmars = TRUE,
sampsizeline = FALSE, effNline = FALSE, sampsizemean = NULL,
effNmean = NULL, ipage = 0, scalebins = FALSE, sexvec = NULL,
multifig_colpolygon = c("grey60", "grey80", "grey70"), multifig_oma = c(5,
5, 5, 2) + 0.1, ...)
``` |

`ptsx` |
vector of x values for points or bars |

`ptsy` |
vector of y values for points or bars of same length as ptsx |

`yr` |
vector of category values (years) of same length as ptsx |

`linesx` |
optional vector of x values for lines |

`linesy` |
optional vector of y values for lines |

`ptsSD` |
optional vector of standard deviations used to plot error bars on top of each point under the assumption of normally distributed error |

`sampsize` |
optional sample size vector of same length as ptsx |

`effN` |
optional effective sample size vector of same length as ptsx |

`showsampsize` |
show sample size values on plot? |

`showeffN` |
show effective sample size values on plot? |

`sampsizeround` |
rounding level for sample size values |

`maxrows` |
maximum (or fixed) number or rows of panels in the plot |

`maxcols` |
maximum (or fixed) number or columns of panels in the plot |

`rows` |
number or rows to return to as default for next plots to come or for single plots |

`cols` |
number or cols to return to as default for next plots to come or for single plots |

`fixdims` |
fix the dimensions at maxrows by maxcols or resize based on
number of elements in |

`main` |
title of plot |

`cex.main` |
character expansion for title |

`xlab` |
x-axis label |

`ylab` |
y-axis label |

`size` |
vector of bubbles sizes if making a bubble plot |

`cexZ1` |
Character expansion (cex) for point associated with value of 1. |

`bublegend` |
Add legend with example bubble sizes to bubble plots. |

`maxsize` |
maximum size of bubbles |

`do.sqrt` |
scale bubbles based on sqrt of size vector. see ?bubble3 for more info. |

`minnbubble` |
number of unique x values before adding buffer. see ?bubble3 for more info. |

`allopen` |
should all bubbles be open? see ?bubble3 for more info. |

`horiz_lab` |
axis labels set horizontal all the time (TRUE), never (FALSE) or only when relatively short ("default") |

`xbuffer` |
extra space around points on the left and right as fraction of total width of plot |

`ybuffer` |
extra space around points on the bottom and top as fraction of total height of plot |

`yupper` |
upper limit on ymax (applied before addition of ybuffer) |

`ymin0` |
fix minimum y-value at 0? |

`axis1` |
position of bottom axis values |

`axis2` |
position of left size axis values |

`linepos` |
should lines be added on top of points (linepos=1) or behind (linepos=2)? |

`type` |
type of line/points used for observed values (see 'type' in ?plot for details) on top of a grey polygon. Default is "o" for overplotting points on lines. |

`polygons` |
should polygons be added to the (turning off is required for sex-ratio plot) |

`bars` |
should the ptsx/ptsy values be bars instead of points (TRUE/FALSE) NOT CURRENTLY FUNCTIONAL |

`barwidth` |
width of bars in barplot, default method chooses based on quick and dirty formula also, current method of plot(...type='h') could be replaced with better approach |

`ptscex` |
character expansion factor for points (default=1) |

`ptscol` |
color for points/bars |

`ptscol2` |
color for negative value points in bubble plots |

`colvec` |
Vector of length 3 with colors for females, males, unsexed fish |

`linescol` |
color for lines |

`lty` |
line type |

`lwd` |
line width |

`pch` |
point character type |

`nlegends` |
number of lines of text to add as legends in each plot |

`legtext` |
text in legend, a list of length=nlegends. values may be any of 1. "yr", 2. "sampsize", 3. "effN", or a vector of length = ptsx. |

`legx` |
vector of length=nlegends of x-values of legends (default is first one on left, all after on right) |

`legy` |
vector of length=nlegends of y-values of legends (default is top for all plots) |

`legadjx` |
left/right adjustment of legends around legx |

`legadjy` |
left/right adjustment of legends around legy |

`legsize` |
font size for legends. default=c(1.2,1.0) (larger for year and normal for others) |

`legfont` |
font type for legends, same as "font" under ?par |

`venusmars` |
Label females and males with venus and mars symbols? |

`sampsizeline` |
show line for input sample sizes on top of conditional age-at-length plots (TRUE/FALSE/scalar, still in development) |

`effNline` |
show line for effective sample sizes on top of conditional age-at-length plots (TRUE/FALSE/scalar, still in development) |

`sampsizemean` |
mean input sample size value (used when sampsizeline=TRUE) |

`effNmean` |
mean effective sample size value (used when effNline=TRUE) |

`ipage` |
which page of plots when covering more than will fit within maxrows by maxcols. |

`scalebins` |
Rescale expected and observed proportions by dividing by bin width for models where bins have different widths? Caution!: May not work correctly in all cases. |

`sexvec` |
vector of sex codes if more than one present (otherwise NULL) |

`multifig_colpolygon` |
vector of polygon fill colors of length 3 (for females, males, and unsexed fish). Can be input to SS_plots and will be passed to this function via the ... argument. |

`multifig_oma` |
vector of outer margins. Can be input to SS_plots and will be passed to this function via the ... argument. |

`...` |
additional arguments (NOT YET IMPLEMENTED). |

Ian Taylor

r4ss documentation built on May 29, 2017, 2:24 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.