delLCP | R Documentation |
You should provide only unique strings (to increase speed).
If only a single string is given, the empty string will be returned unless minOutputLength
is set.
delLCP(x, min_out_length = 0, add_dots = FALSE)
x |
Vector of strings with common prefix |
min_out_length |
Minimal length of the shortest element of x after LCP removal [default: 0, i.e. empty string is allowed] . If the output would be shorter, the last part of the LCP is kept. |
add_dots |
Prepend output with '..' if shortening was done. |
Shortened vector of strings
delLCP(c("TK12345_H1"), min_out_length=0)
## ""
delLCP(c("TK12345_H1"), min_out_length=4)
## "5_H1"
delLCP(c("TK12345_H1"), min_out_length=4, add_dots = TRUE)
## "..5_H1"
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=4)
## "5_H1" "5_H2"
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=4, add_dots = TRUE)
## "..5_H1" "..5_H2"
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=8)
## "12345_H1", "12345_H2"
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=8, add_dots = TRUE)
## "TK12345_H1", "TK12345_H2" (unchanged, since '..' would add another two)
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=60)
## "TK12345_H1", "TK12345_H2" (unchanged)
delLCP(c("TK12345_H1", "TK12345_H2"), min_out_length=60, add_dots = TRUE)
## "TK12345_H1", "TK12345_H2" (unchanged)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.