Create ggplot2 plots in a loop.
ggloop allows the user to use create multiple ‘ggplot2’ plots. Plots are created by passing multiple aesthetics via a vector of aesthetics to ggloop()
. Users can use both dplyr-like syntax (i.e. x = mpg:hp
, y = 1
, color = 4:8
, etc) and ggplot2-like syntax (i.e x = mpg/cyl
, y = wt + hp
, color = factor(cyl)
, etc).
## CRAN
install.packages("ggloop")
## GitHub
devtools::install_github("seasmith/ggloop")
You can see ggloop
in action with the intro vignette (vignette("intro", "ggloop")
). You can also see the example and the very brief overview available below.
ggloop
has three exported functions:
ggloop(data, mappings = aes_loop(), remap_xy = TRUE, remap_dots = FALSE, ..., environment = parent.frame() )
ggplot2::ggplot()
and its arguments.x
, y
, and ...
arguments of length one or less....
argument in aes_loop()
....
argument is supplied. ...
names sit on the top-level of the nested list (they divide the list into however many parts based on the number of such arguments and the remapping behavior). x
and y
sit at the bottom-level of the nested listaes_loop()
aes()
c()
and NOT have any nested c()
.dplyr-like
= mpg:hp
, 1
, 5:9
, cyl
, etc.ggplot2-like
= factor(cyl)
, gear + cyl
, etc.c()
as a wrapper and only c()
.%L+%
+
operator for a nested list, list, or single ‘ggplot’ object.