powered by
str_trunc() truncates a string to a given width.
str_trunc()
str_trunc(str, width = 0.9 * getOption("width"), ellipsis = "[...]")
(character()) Vector of strings.
character()
(integer(1)) Width of the output.
integer(1)
(character(1)) If the string has to be shortened, this is signaled by appending ellipsis to str. Default is "[...]".
character(1)
ellipsis
str
"[...]"
(character()).
# NOT RUN { str_trunc("This is a quite long string", 20) # }
Run the code above in your browser using DataLab