📜  rscript 参数输入 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:15.449000             🧑  作者: Mango

代码示例1
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
# test if there is at least one argument: if not, return an error
if (length(args)==0) {
  stop("At least one argument must be supplied (input file).n", call.=FALSE)
} else if (length(args)==1) {
  # default output file
  args[2] = "out.txt"
}