View source: R/text_formatting.R
append_newline_if_needed | R Documentation |
Append newlines to the end of strings.
append_newline_if_needed(
txt,
start_par = FALSE,
extra_lines = 0,
collapse = NULL
)
txt |
A vector of character strings. |
start_par |
Add a newline at the beginning of the string.
If there is more than one string in |
extra_lines |
The number of blank lines to follow the string.
If there is more than one string in |
collapse |
Collapse all strings in |
Take a character vector, ensure that each element ends in a newline, Optionally add an extra newline to the beginning of each element, add extra blank lines at the end, and optionally concatenate the elements together into a single string, separated by an optional separator in addition to the new lines.
A vector of character strings.
append_newline_if_needed("foo")
append_newline_if_needed("foo", start_par = TRUE)
append_newline_if_needed("foo", extra_lines = 3)
append_newline_if_needed(month.abb, start_par = c(TRUE, rep(FALSE, 11)),
collapse = TRUE)
append_newline_if_needed(month.abb, collapse = "...")
append_newline_if_needed(c("Months:", month.abb, extra_lines = 0,
collapse = "* "))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.