Learn R Programming

gridify (version 0.7.4)

pharma_layout_letter: Pharma Layout (Letter) for a gridify object

Description

This function sets up the general structure for positioning the text elements for pharma layouts using the letter paper size.

Usage

pharma_layout_letter(global_gpar = NULL, background = grid::get.gpar()$fill)

Value

A gridifyLayout object with the structure defined for letter paper size.

Arguments

global_gpar

A list specifying global graphical parameters to change in the layout. Default is NULL, however the defaults in the layout, inherited from pharma_layout_base(), are: fontfamily = "Serif", fontsize = 9 and lineheight = 0.95, which can be overwritten alongside other graphical parameters found by grid::get.gpar().

background

A character string specifying the background fill colour. Default grid::get.gpar()$fill for a white background.

Details

The margins for the letter layout are:

  • top = 1 inch

  • right = 1 inch

  • bottom = 1.23 inches

  • left = 1 inch

The pharma_layout_base() function is used to set up the general layout structure, with these specific margins applied for the letter format.

See Also

pharma_layout, pharma_layout_base(), pharma_layout_A4()

Examples

Run this code
pharma_layout_letter()

library(magrittr)
# Example with all cells filled out
gridify(
  object = ggplot2::ggplot(data = mtcars, ggplot2::aes(x = mpg, y = wt)) +
    ggplot2::geom_line(),
  layout = pharma_layout_letter()
) %>%
  set_cell("header_left_1", "My Company") %>%
  set_cell("header_left_2", " / ") %>%
  set_cell("header_left_3", "") %>%
  set_cell("header_right_1", "CONFIDENTIAL") %>%
  set_cell("header_right_2", "") %>%
  set_cell("header_right_3", "Data Cut-off: YYYY-MM-DD") %>%
  set_cell("output_num", " xx.xx.xx") %>%
  set_cell("title_1", "") %>%
  set_cell("title_2", "<Title 2>") %>%
  set_cell("title_3", "<Optional Title 3>") %>%
  set_cell("by_line", "By: <GROUP>, <optionally: Demographic parameters>") %>%
  set_cell("note", "<Note or Footnotes>") %>%
  set_cell("references", "<References:>") %>%
  set_cell("footer_left", "Program: <PROGRAM NAME>, YYYY-MM-DD at HH:MM") %>%
  set_cell("footer_right", "Page xx of nn") %>%
  set_cell("watermark", "DRAFT")

Run the code above in your browser using DataLab