Description Usage Arguments Details Value Author(s) Examples
The height and width of a layer which draws texts often involves with the
number of line breaks ('\n'
) in the texts. These two functions give
the preferred height and width of a layer as a rule of thumb.
1 2 3 | prefer_height(text)
prefer_width(text, horizontal = TRUE)
|
text |
the character vector to be drawn in the layer |
horizontal |
logical: the text is drawn horizontally
( |
Usually the height and width of the title layer and x- and y-axis layers need to be adjusted dynamically.
The height or width (numeric).
Yihui Xie <http://yihui.name>
1 2 3 4 5 6 | prefer_height("a label")
prefer_height("this is\na label")
prefer_width("abc")
prefer_width("a long long label")
prefer_width("line\nbreaks") # 'breaks' dominates the width because it is wider
prefer_width("multiple\nvertical\nlines", horizontal = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.