[R] A problem with text manipulation

Christofer Bogaso bogaso.christofer at gmail.com
Mon Mar 4 20:13:49 CET 2013


Hello again,

Let say I have following vector:

set.seed(1)
Vec <- sample(LETTERS[1:5], 10, replace = TRUE)
Vec

Now with each repeated letter, I like to add suffix programatically.
Therefore I want to get following vector:

c("B", "B1", "C", "E", "B2", "E1", "E2", "D", "D1", "A")

Can somebody tell me how to achieve that?

Thanks and regards,



More information about the R-help mailing list