
Convert a vector into a comma separated text
vector2text(vector, sep = ", ", quotes = TRUE, force_single = FALSE, and = "")v2t(vector, sep = ", ", quotes = TRUE, force_single = FALSE, and = "")
Vector. Vector with more than 1 observation.
Character. String text wished to insert between values.
Boolean. Bring simple quotes for each observation.
Boolean. Force single quotes by replacing \"
.
Character. Add 'and' or something before last observation.
Not boolean variable so it can be used on other languages. Note that
the last comma will be suppressed if Sys.getenv("LARES_NUMFORMAT")
is set to 1
and you have less than 3 values.
Vector pasting vector
values into a single string
Other Data Wrangling:
balance_data()
,
categ_reducer()
,
cleanText()
,
date_cuts()
,
date_feats()
,
formatNum()
,
holidays()
,
impute()
,
left()
,
normalize()
,
numericalonly()
,
ohe_commas()
,
ohse()
,
removenacols()
,
removenarows()
,
replaceall()
,
textFeats()
,
textTokenizer()
,
year_month()
# NOT RUN {
vector2text(LETTERS[1:5])
vector2text(c(1:5), quotes = FALSE)
vector2text(c(1:5), quotes = FALSE, sep = "-")
vector2text(c(1:5), and = "and also")
vector2text(c("Text", "R's"), force_single = TRUE)
# Shorter function with same purpose
v2t(LETTERS[1:5])
# }
Run the code above in your browser using DataLab