I looked, but could not find an answer on how to add a character to the end of each element in a row vector in R , except for the last ...
Consider the following:
data <- c("cat", "dog", "mouse", "lion")
I would like to apply a function that inserts a "," at the end of each element in such a way that the result is:
[1] "cat,", "dog,", "mouse,", "lion"
apply functions? for the cycle? any help is appreciated ...
r
gh0strider18
source share