common_stem | R Documentation |
Return the stem that is common to a set of strings
common_stem(..., side = "left", na.rm = FALSE)
... |
(Vectors) Vectors that will be coerced into Character and appended together. |
side |
(Character) Search from the |
na.rm |
(Logical) Should |
A string. If there is no common stem among all the words, an empty string of length 1 ("") will be returned.
Desi Quintans (http://www.desiquintans.com)
vec <- c("exciting", "exceeding", "excepting")
common_stem(vec)
#> [1] "exc"
common_stem(vec, side = "r")
#> [1] "ing"
# The function does not return substrings:
common_stem("tableaux", "wobbles")
#> ""
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.