Filter data for input into aesthetics for ggplot2
filter_data(
dat,
label_name,
module = NULL,
era = "time",
geom,
group = NULL,
facet = NULL,
scale_amount = 1,
interactive = TRUE
)a data frame or list of data frames input as `list()` that contains the data to be plotted.
a string of the name of the label that is used to filter the data.
(Optional) A string indicating the linked module_name associated with the label for the plot if known. Default is NULL. By default, the function will select the most relevant module if more than 1 exists. If selecting more than one module, place them in a vector such as c("module1", "module2").
A string naming the era of data such as historical ("early"), current ("time"), or projected ("fore") data if filtering should occur. Default is set to "time" which is the current time. To plot all data, set era to NULL.
Type of plot user wants to create. Options are "line", "point", and "area".
Name of a column selected grouping for the data.
a string or vector of strings of a column that facets the data (e.g. "year", "area", etc.)
A number describing how much to scale down the quantities shown on the y axis.
logical. If TRUE, the user will be prompted to select a module_name when there was more than one found in the filtered data set.
a data frame that is preformatted for plotting with ggplot2.
if (FALSE) { # \dontrun{
filter_data(dat, "biomass", "line", group = "fleet")
} # }