This functions lets the user extract the first or last n characters of a string or vector of strings.
See also
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
file_name()
,
formatHTML()
,
holidays()
,
impute()
,
normalize()
,
num_abbr()
,
ohe_commas()
,
ohse()
,
quants()
,
removenacols()
,
replaceall()
,
replacefactor()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
zerovar()
Examples
left("Bernardo", 3)
#> [1] "Ber"
right(c("Bernardo", "Lares", "V"), 3)
#> [1] "rdo" "res" "V"