Learn R Programming

ggtibble

The goal of ggtibble is to allow creation of similarly-formatted figures as lists of ggplots (gglist) and tibbles of those lists with captions. These are augmented with knit_print() methods enabling simple inclusion in reports.

Installation

You can install the development version of ggtibble from GitHub with:

# install.packages("devtools")
devtools::install_github("humanpred/ggtibble")

Example

This is a basic example which shows you how to solve a common problem:

library(ggtibble)
d_plot <-
  data.frame(
    A = rep(c("foo", "bar"), each = 4),
    B = 1:8,
    C = 11:18,
    Bunit = "mg",
    Cunit = "km"
  )
all_plots <-
  ggtibble(
    d_plot,
    ggplot2::aes(x = B, y = C),
    outercols = c("A", "Bunit", "Cunit"),
    caption = "All the {A}",
    labs = list(x = "B ({Bunit})", y = "C ({Cunit})")
  ) +
  ggplot2::geom_point() +
  ggplot2::geom_line()
knit_print(all_plots)

Copy Link

Version

Install

install.packages('ggtibble')

Monthly Downloads

240

Version

1.0.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Bill Denney

Last Published

June 11th, 2025

Functions in ggtibble (1.0.2)

labs_glue

Generate ggplot2 labels based on data in a ggtibble
knit_print.gg

Print a ggplot (usually within knit_print.gglist)
%+%

Use the %+% operator from ggplot2 for ggtibble and gglist objects
new_ggtibble

Create a new ggtibble object
knit_print.gglist

Print a list of plots made by gglist
new_gglist

Create a new gglist object
gglist

Generate a list of ggplots from a list of data.frames
extract_glue_expr

Extract all expressions to be evaluated by glue()
ggsave

Save a plot or list of plots
ggtibble

Make a tibble where one column is the data to plot, one is the gglist, and one is the caption
reexports

Objects exported from other packages