| layout_lines | R Documentation |
Give the line of each piece of a text, from their widths, for
a maximum width. This is the part shared by gen_grob() and the packages that
draw rich text with 'grid'.
A piece that makes the line too wide goes to the next line, except if it is the first of its line. Spaces are dropped when they do not fit and at the start of a line that follows an automatic line break; they are kept after a line break of the text, as they were written. A line break ends its line, and gives a line of its own if that line is empty.
A word wider than a line is first moved to a new line, then split between
its characters: give its characters as pieces and set break_before to TRUE
on the first one.
layout_lines(
width,
newline,
space,
max_width,
first_line = 0,
hanging = 0,
break_before = FALSE
)
width |
widths of the pieces. |
newline, space |
logical vectors, |
max_width |
maximum width of a line, |
first_line, hanging |
width removed from the first line, and from the other lines. |
break_before |
logical, |
An integer vector, the line of each piece, 0 for the dropped pieces.
layout_lines(
width = c(2, 1, 2, 1, 3),
newline = rep(FALSE, 5),
space = c(FALSE, TRUE, FALSE, TRUE, FALSE),
max_width = 5
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.