Arrange SPR input plots into a report-ready grid
grid_spr_inputs.RdCombine list output from plot_spr_inputs() into a multi-panel figure
using patchwork. Because patchwork is in Suggests, this function
will only run when it is installed.
Usage
grid_spr_inputs(
plots,
order = NULL,
ncol = 1,
nrow = NULL,
guides = c("collect", "keep"),
title = NULL,
caption = NULL
)Arguments
- plots
A named list of ggplot objects returned by
plot_spr_inputs().- order
Character vector giving the plot names (in
plots) in the order to arrange. Defaults tonames(plots).- ncol
Number of columns in the grid.
- nrow
Optional number of rows. If
NULL, patchwork chooses automatically.- guides
Passed to
patchwork::plot_layout(guides = ...). Default"collect"collects legends when possible.- title
Optional figure title (character). Added with
patchwork::plot_annotation().- caption
Optional figure caption (character). Added with
patchwork::plot_annotation().
Details
Typical usage:
inp_plots <- plot_spr_inputs(inp, panels = c("mat_selex","wt","len","M"))
grid_spr_inputs(inp_plots, order = c("mat_selex","wt","len","M"), ncol = 1)