insert_text: Insert text to forest plot

View source: R/insert_text.R

insert_textR Documentation

Insert text to forest plot

Description

This function can be used to insert text to forest plot. Remember to adjust for the row number if you have added text before, including header. This is achieved by inserted new row(s) to the plot and will affect the row number. A text vector can be inserted to multiple columns or rows.

Usage

insert_text(
  plot,
  text,
  row = NULL,
  col = NULL,
  part = c("body", "header"),
  just = c("center", "left", "right"),
  before = TRUE,
  gp = gpar(),
  padding = unit(1, "mm"),
  parse = FALSE
)

Arguments

plot

A forest plot object.

text

A character or expression vector, see textGrob.

row

Row to insert the text, this will be ignored if the part is "header".

col

A numeric value or vector indicating the columns the text will be added. The text will span over the column if a vector is given.

part

Part to insert text, body (default) or header.

just

The justification of the text, "center" (default), "left" or "right".

before

Indicating the text will be inserted before or after the row.

gp

An object of class "gpar", this is the graphical parameter settings of the text. See gpar.

padding

Padding of the text, default is unit(1, "mm")

parse

Logical, behaviour for parsing text as plotmath, see plotmath

Value

A gtable object.

See Also

gpar textGrob gtable_add_grob


forestploter documentation built on May 29, 2024, 5:48 a.m.