Learn R Programming

gridify (version 0.7.4)

show_spec: Show the layout specifications of a gridifyClass or gridifyLayout

Description

Method for showing the specifications of the layout in a gridifyClass or gridifyLayout object, including, but not limited to:

  • Layout dimensions

  • Heights of rows

  • Widths of columns

  • Margins

  • Graphical parameters defined in the layout.

  • Default specs per cell.

Usage

show_spec(object)

# S4 method for gridifyLayout show_spec(object)

# S4 method for gridifyClass show_spec(object)

Value

A print out of the specifications of a gridifyClass or gridifyLayout object.

Arguments

object

A gridifyClass or gridifyLayout object.

Examples

Run this code
show_spec(complex_layout())

# (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")

show_spec(g)

g <- gridify(
  object = ggplot2::ggplot(data = mtcars, ggplot2::aes(x = mpg, y = wt)) +
    ggplot2::geom_line(),
  layout = complex_layout()
) %>%
  set_cell("header_left", "Left Header") %>%
  set_cell("header_right", "Right Header") %>%
  set_cell("title", "Title") %>%
  set_cell("note", "Note") %>%
  set_cell("footer_left", "Left Footer") %>%
  set_cell("footer_right", "Right Footer")

show_spec(g)

Run the code above in your browser using DataLab