powered by
str_trunc() truncates a string to a given width.
str_trunc()
str_trunc(str, width = 0.9 * getOption("width"), ellipsis = "[...]")
(character()).
character()
(character()) Vector of strings.
(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
"[...]"
str_trunc("This is a quite long string", 20)
Run the code above in your browser using DataLab