我尝试一起按顺序打印出文件名。我当前的代码只能单独打印出来(2018和2019文件)。我如何解决它?谢谢
我当前的代码:
month1=4:12
month2=1:2
f1=paste("trips-2018-",month1,".csv",sep="")
f2=paste("trips-2019-",month2,".csv",sep="")
f1
f2
输出:
[1] "trips-2018-4.csv" "trips-2018-5.csv" "trips-2018-6.csv" "trips-2018-7.csv"
[5] "trips-2018-8.csv" "trips-2018-9.csv" "trips-2018-10.csv" "trips-2018-11.csv"
[9] "trips-2018-12.csv"
[1] "trips-2019-1.csv" "trips-2019-2.csv"
我希望输出:
[1] "trips-2018-4.csv" "trips-2018-5.csv" "trips-2018-6.csv"
[4] "trips-2018-7.csv" "trips-2018-8.csv" "trips-2018-9.csv"
[7] "trips-2018-10.csv" "trips-2018-11.csv" "trips-2018-12.csv"
[10] "trips-2019-1.csv" "trips-2019-2.csv"