Use ezplot to quickly create presentation-ready charts that are also useful for exploratory data analysis. By default, ezplot functions aggregate multiple values of y for repeated categories of x, group, facet_y and facet_x.
library(ezplot)
suppressPackageStartupMessages(library(tsibble))
library(tsibbledata)
suppressPackageStartupMessages(library(lubridate))
library(ggplot2)
library(grid)
Weekly aggregation:
Add grouping:
Add faceting:
line_plot(ansett, x = "Week", y = "Passengers",
group = "Class", facet_x = "Airports",
facet_scales = "free_y", size = 10) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.38, hjust = 1))
Plot YOY comparisons:
line_plot(gafa_stock, "Date", c("Closing Stock Price" = "Close"),
facet_y = "Symbol",
facet_scales = "free_y",
yoy = TRUE,
labels = function(x) ez_labels(x, prepend = "$"))
Plot multiple numeric columns:
Weekly aggregation:
Add grouping:
Add faceting: