0

What is the most efficient way to do this in R?

VIC <- c()
for(i in 1:12){
  VIC[i] <- paste0("NG.FWD.P_TFI_M",i,":HELLO")
}
Freddie
  • 65
  • 4

1 Answers1

1

Vectorizing your for loop:

paste0("NG.FWD.P_TFI_M",1:12,":HELLO")
mtoto
  • 23,919
  • 4
  • 58
  • 71