We can concatenate two or more strings in R by using the paste()
or cat()
functions. The first approach is more popular. Both functions take in any number of strings to be concatenated and can also take in an optional parameter sep
(along with some other optional parameters)—a character or a sequence of characters that will separate attached strings in the resulting string (a white space by default).
Leave a Reply