print-gridifyClass-method: Print method for gridifyClass

print,gridifyClass-methodR Documentation

Print method for gridifyClass

Description

Method for printing a gridifyClass object. Prevents the show method from being triggered.

Usage

## S4 method for signature 'gridifyClass'
print(x, ...)

Arguments

x

A gridifyClass object.

...

Additional arguments. Not yet in use.

Value

Invisibly a grid call used to draw the object.

See Also

gridify(), set_cell()

Examples

# (to use |> version 4.1.0 of R is required, for lower versions we recommend %>% from magrittr)
library(magrittr)

g <- gridify(
  object = ggplot2::ggplot(data = mtcars, ggplot2::aes(x = mpg, y = wt)) +
    ggplot2::geom_line(),
  layout = simple_layout()
) %>%
  set_cell("title", "TITLE")

print(g)

# grid call is returned when printed to a variable
gg <- print(g)
# unevaluated grid code
gg
# evaluate the code
grid::grid.draw(eval(gg, envir = attr(gg, "env")))
# or
OBJECT <- attr(gg, "env")[["OBJECT"]]
grid::grid.draw(eval(gg))

gridify documentation built on Feb. 5, 2026, 5:09 p.m.