R语言接收命令行参数

R语言接收命令行参数

Args <- commandArgs()
print(Args)

调用结果如下:

 $ Rscript correctReads.R 1 2 3
[1] "/Library/Frameworks/R.framework/Resources/bin/exec/R"
[2] "--slave"
[3] "--no-restore"
[4] "--file=correctReads.R"
[5] "--args"
[6] "1"
[7] "2"
[8] "3"
    原文作者:gada
    原文地址: https://www.jianshu.com/p/7708f022320a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞