evenstrings | R Documentation |
The function shortens and cuts a given vector to a predefined length.
evenstrings(x = c(), split = " ", char = 80, newlines = FALSE)
x |
a string |
split |
a pattern with the splitting symbol. The default is " ". |
char |
a numeric with the maximum length of the result. |
newlines |
a boolean that indicates if the output is seperated by a newline operator or split into multiple parts. |
The splitting is done with strsplit
with
type = "after"
.
returns a vector with the shortened and cut input string
Jakob Gepp
x <- "Hello world, this is a test sequence."
evenstrings(x, split = ",", char = 30, newlines = FALSE)
# [1] "Hello world," " this is a test sequence."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.