I need following: repeat two values, each 3 times: I can do it with
rplcts = rep(c("Trt","Ctl"), each=3) but I also want to add to each string in one group following values: 1,2,3 so, at the end I need this:
"Ctl1" "Ctl2" "Ctl3" "Trt1" "Trt2" "Trt3" Is there a smart way to do it in r?
paste0(rep(c("Trt","Ctl"), each=3), c(1, 2, 3))?paste0(rplcts, 1:3)