第一题可这么写:
getwd() a<-1:10000 b<-paste0('A',a) print(b) b1=c() for (i in 1:length(b)){ if (i%%2==0) b1=c(b1,b[i]) } c<-gsub('A','B',b1) print(c)