cleanup_spaces | R Documentation |
The function cleanup_spaces()
takes a character vector and input and turns
any uninterrupted stretch of whitespace characters into one single space character.
Moreover, it can also remove leading whitespace and trailing whitespace.
cleanup_spaces(x, remove_leading = TRUE, remove_trailing = TRUE)
x |
Character vector. |
remove_leading |
Logical. If |
remove_trailing |
Logical. If |
A character vector.
txt <- " A \\t small example \\n with redundant whitespace " cleanup_spaces(txt) cleanup_spaces(txt, remove_leading = FALSE, remove_trailing = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.