Cebs Cebs - 4 months ago 7
R Question

seq with a constant r

I'm looking to create a seq with a constant part. Something like this:
GBR1
GBR2
.
.
.
GBR50000

I tried to do it with the seq function but I was not successful. Does anyone know how to easily do the trick?

Answer

Try this

paste("GBR",1:50000,sep = "")

or

sprintf("GBR%d", 1:5e5)