View source: R/table-dots-functions.R
substring.with.dots.adv | R Documentation |
Sometimes we need to summarize long strings, and we need a bit og the head and a bit of the tail, and some indication that we are not seeing the full string. This function does that plus it can pad dots or other symbons before of after the string, if it is not long. See also table.dots and substring.with.dots.
substring.with.dots.adv(c("Hello","khdskhdsjkdkahdshkdhkahskaksdjh"),n=15,reverse=!TRUE,n.last=5)
print(c("Hello ........." ,"khdskhd...aksdj"))
x |
string to be modified |
n |
desired length of string after manipulations |
reverse |
controls if the dots are added before of after the main string |
n.last |
number of characters from the tail |
mid.string |
what to put between the head and the tail to indicate that some part of the mid section has been cut out. |
string with given length including head, tail and a midsection.
Claus E. Andersen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.