Filter data for input into aesthetics for ggplot2

filter_data(
  dat,
  label_name,
  module = NULL,
  era = NULL,
  geom,
  group = NULL,
  facet = NULL,
  scale_amount = 1,
  interactive = TRUE
)

Arguments

dat

A tibble or named list of tibbles (input as `list()`) returned from convert_output.

If inputting a list of tibbles, the first tibble's reference point defined in `ref_line` is used to plot a reference line or calculate relative spawning biomass.

label_name

a string of the name of the label that is used to filter the data.

module

(Optional) A string indicating the module_name found in `dat`. If selecting >1 module, place them in a vector like c("module1", "module2").

Default: NULL

If the interactive and >1 module_name is found, user will select the module_name in the console. @seealso [filter_data()]

era

A string naming the era of data.

Default: "time"

Options: "early", "time", "fore" (forecast), or NULL (all data)

geom

A string stating the geom used for the plot.

Default: "line".

Options: "line", "point", or "area"

group

A string of a single column that groups the data.

Set group = "none" to summarize data over all indexing values.

Default: NULL Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL

facet

A string or vector of strings of a column name.

Default: NULL

scale_amount

A number to scale the y-axis values.

Default: 1

interactive

A logical value indicating if the environment is interactive.

Default: `FALSE`

Value

a data frame that is preformatted for plotting with ggplot2.

Examples

if (FALSE) { # \dontrun{
filter_data(dat, "biomass", "line", group = "fleet")
} # }