supCount | R Documentation |
If there is no unique prefix (e.g. if a string is contained twice), then the length of the longest string is returned, i.e. if the return value is used in a call to substr, nothing happens e.g. substr(x, 1, supCount(x)) == x
supCount(x, prefix_l = 1)
x |
Vector of strings |
prefix_l |
Starting prefix length, which is incremented in steps of 1 until all prefixes are unique (or maximum string length is reached) |
Integer with minimal prefix length required
supCount(c("abcde...", "abcd...", "abc...")) ## 5
x = c("doubled", "doubled", "aLongDummyString")
all( substr(x, 1, supCount(x)) == x )
## TRUE (no unique prefix due to duplicated entries)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.