
This functions lets the user extract the first or last n characters of a string or vector of strings.
left(string, n = 1)right(string, n = 1)
String or Vector.
Integer. How many characters starting on right/left?
Character. Trimmed strings.
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
formatNum()
,
holidays()
,
impute()
,
normalize()
,
numericalonly()
,
ohe_commas()
,
ohse()
,
removenacols()
,
removenarows()
,
replaceall()
,
textFeats()
,
textTokenizer()
,
vector2text()
,
year_month()
,
year_week()
# NOT RUN {
left("Bernardo", 3)
right(c("Bernardo", "Lares", "V"), 3)
# }
Run the code above in your browser using DataLab