Make a time series line plot of the variables in the given data frame, with each variable in its own facet.

ggplot_ecodata_facet(
  data,
  variables = NULL,
  title = "",
  ylab = NULL,
  ncol = 4,
  scales = "free",
  color = "dodgerblue4",
  title_strlen = 60,
  strip_width = 40,
  plot.recessions = FALSE
)

Arguments

data

Data frame from `get_ecodata()` that includes a variable called `Date` and the other variables to plot

variables

Optional, vector of strings that includes the economic variables to plot. If not specified, the function will plot all the variables given in `data`, if possible.

title

Optional, string for the title of the plot. Default is ""

ylab

Optional, string for the y-axis label. Default is the units of the meta data for the variables to be plotted

ncol

Optional, number of columns for the facet plot. Default is 4.

scales

Optional, string passed to `facet_wrap()` on whether to fix or free the scales on the x and y axes

color

Optional, color of the lines. Default is "dodgerblue4"

title_strlen

Optional, word-wrap the length of the title by this many characters. Default = 60.

strip_width

Optional, word-wrap variable in the title of the individual facet. Default = 40.

plot.recessions

Optional, logical for whether or not show show NBER recession bars in the plot

Value

Returns a ggplot, faceted by each economic variable