我有一个bash脚本,创建一个csv文件和一个R文件,从中创建图形.
在bash脚本结尾,我调用Rscript Graphs.R 10
我得到的答复如下:
- Error in is.vector(X) : subscript out of bounds
- Calls: print ... <Anonymous> -> lapply -> FUN -> lapply -> is.vector
- Execution halted
我的Graphs.R的前几行是:
- #!/bin/Rscript
- args <- commandArgs(TRUE)
- CorrAns = args[1]
不知道我在做错什么?对网上的建议,对我来说,这应该是正常的.它很难让commandArgs有意义