shorten: Shorten names

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/tidy_rname.R

Description

Shorten names in a character vector, keeping the begining and the end

Usage

1
shorten(char, max_size = 16, tail_keep = 3)

Arguments

char

A character vector with the names.

max_size

Integer. Number max of character. If 0, no limits. Will not cut words < of 8 letters. Default is 16. Will keep the first letters and the last ones (a least 3)

tail_keep

Integer. Number max of character to keep at the end of the words. If 0, don't keep any character. Must be < to max_size. Default is 3.

Details

The function keep

Value

A character vector with shorten names.

Author(s)

Joris Muller

See Also

This function is used by tidy_rname to produce the short enough names.

Examples

1
2
3
bad_names <- c("short", "looooooooognameeeeeeee")
transformed_names <- shorten(bad_names)
transformed_names

jomuller/vartors documentation built on May 19, 2019, 7:26 p.m.