Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

str_trunc

Truncate Strings


Description

str_trunc() truncates a string to a given width.

Usage

str_trunc(str, width = 0.9 * getOption("width"), ellipsis = "[...]")

Arguments

str

(character())
Vector of strings.

width

(integer(1))
Width of the output.

ellipsis

(character(1))
If the string has to be shortened, this is signaled by appending ellipsis to str. Default is "[...]".

Value

(character()).

Examples

str_trunc("This is a quite long string", 20)

mlr3misc

Helper Functions for 'mlr3'

v0.10.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.