Description Usage Arguments Details Value Examples
condense_str
shortens a string to a specified length. View details for explanation.
1 2 | condense_str(x, cutoff = 30, strict = FALSE, rm.spaces = FALSE,
rm.words = NULL)
|
x |
A string. |
cutoff |
Cutoff index. |
strict |
Return string with nchar less than or equal to cutoff index? |
rm.spaces |
Remove all spaces in string after condensing? |
rm.words |
A vector of characters or words to be removed from |
condense_str
will not cut off a string midword. If your string's nth character (where n = cutoff) lies in the middle of a word,
condense_str
looks for the end of that word then cuts off the string there.
If strict is set to TRUE, condense_str
will always return a string where the number of characters
is less than or equal to cutoff.
A condensed version of x
.
1 2 3 4 | condense_str("This is a test string", cutoff = 13)
condense_str("This is a test string", cutoff = 13, strict = T, rm.spaces = T)
condense_str("This is a test string", cutoff = 13, strict = T, rm.words = c("This","test"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.