text_trunc: Truncate longer texts

Description Usage Arguments Examples

View source: R/strings.R

Description

Truncate longer texts

Usage

1
text_trunc(x, value = 15, symbol = "...", sep = "")

Arguments

x

a vector.

value

threshold for truncation.

symbol

the suffix symbol for the truncation. Default: ...

sep

separator between the three-dots and truncated text.

Examples

1
2
3
4
5
## Not run: 
text_trunc(c("apple", "this is a long text with more letters in it"))
text_trunc("The quick brown fox jumps over the lazy dog", 20, sep = " ")

## End(Not run)

strboul/mmy documentation built on Sept. 24, 2021, 12:08 p.m.