shorten_string: Shorten Character Strings

Description Usage Arguments

View source: R/shorten.r

Description

Shorten Character Strings

Usage

1
2
3
4
5
6
7
8
9
shorten_string(
  x,
  min_len = 3,
  max_len = 10,
  max_total = 18,
  sep = " ",
  outsep = "_",
  cruft_pattern = "[aeiou\\-]"
)

Arguments

x

a vector of characters.

min_len

the minimum length a string can be without being dropped. Default 3.

max_len

the maximum length a string can be. If it's longer it gets truncated. Default 10.

max_total

the maximum total size of the shortened string. Default 18.

sep

the string separators. Default " ".

outsep

the shortened string separator. Default "_".

cruft_pattern

the regex desribing the characters that will be dropped from the string.


presagia-analytics/normalizer documentation built on Dec. 12, 2019, 7:40 a.m.