args <- commandArgs(trailingOnly = FALSE) #trailingOnly默认的就是FALSE for(i in 1:length(args)){ print(sprintf("第%d个参数是:%s", i, args[i])) }