Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Say I have two character vectors:
a <- c("a", "b", "c") b <- c("1", "2", "3")
How do I merge them such that I get:
ab <- c("a1", "b2", "c3")
paste
You can use paste or paste0:
paste0
> a <- c("a", "b", "c") > b <- c("1", "2", "3") > paste0(a, b) [1] "a1" "b2" "c3" >
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
paste. The linked question tells you enough about the function to be able to use it for your problem.