vec_char_redu: Reduce Number of Character

View source: R/utilities.R

vec_char_reduR Documentation

Reduce Number of Character

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

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

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

yduan004/signatureSearch documentation built on Feb. 19, 2024, 9:30 a.m.