I have the following database
library(data.table)
dt <- data.table(prod= c("AAAA","BBBB","CCCC"),
version= c(4,3,5))
And I want to obtain this
AAAA1
AAAA2
AAAA3
AAAA4
BBBB1
BBBB2
BBBB3
CCCC1
CCCC2
CCCC3
CCCC4
CCCC5
Now I have the following code, but it only works for the AAAA but not for the rest
list <- c()
for(i in 1:dt$version){
list[[i]] <- paste0(dt$prod,i)
}