直接通过Rsript xx.R arg1 arg2 arg3 arg4 arg5运行脚本。这种方法只能设置位置参数,各参数位置固定,不能写乱,所以如果参数简单且数量少,可以用此种方法。 如果不设置参数控制,直接在脚本第一行写一句Args <- commandArgs(T)即可,然后直接Rscript xx.R a1 a2运行脚本,参数a1,a2的值会存储在Args中,脚本中使用Args , Args[[1]], Args[[2]], Args[[3]], Args[[4]], Args[[5]])终端中运行Rscript xx.R arg1 arg2 arg3 arg4 arg5。 \nPlease use Rscript xx.R -h to get help info\n") }) }终端运行 Rscript xx.R -n yyds -t 8 -m 1 -p 0.05
/xx.R ../Input/split/${id} ../Input/genotype_name.txt .. /xx.R ../Input/split/id.text ../Input/genotype_name.txt ../Out/id.text Rscript ./xx.R .. /xx.R ../Input/split/test10 ../Input/genotype_name.txt ../Out/test10 Rscript ./xx.R ..