vec_char_redu: Reduce Number of Character

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Reduce number of characters for each element of a character vector by replacting the part that beyond Nchar (e.g. 50) character to '...'.

Usage

1
vec_char_redu(vec, Nchar = 50)

Arguments

vec

character vector to be reduced

Nchar

integer, for each element in the vec, number of characters to remain

Value

character vector after reducing

Examples

1
2
vec <- c(strrep('a', 60), strrep('b', 30))
vec2 <- vec_char_redu(vec, Nchar=50)

signatureSearch documentation built on April 16, 2021, 6 p.m.