i <- 3 assign(paste0('myVar', i), 1:5) myVar3 ## [1] 1 2 3 4 5
更多:https://bbs.pinggu.org/thread-6853714-1-1.html