| print,gridifyClass-method | R Documentation |
Method for printing a gridifyClass object.
Prevents the show method from being triggered.
## S4 method for signature 'gridifyClass'
print(x, ...)
x |
A gridifyClass object. |
... |
Additional arguments. Not yet in use. |
Invisibly a grid call used to draw the object.
gridify(), set_cell()
# (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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.