I am trying to run an R
script called test.r
through qsub
. My R
script is as follows:
#!/usr/bin/Rscript
x <- 1
write.csv(x,"test.csv")
If in Ubuntu terminal I type R CMD BATCH test.r
, then the script behaves as planned; test.csv
gets exported in the same directory.
However if I create a bash
script called testbash.sh
and run it through the command qsub testbash.sh
; it will run without errors but the output won't be there.
#!/usr/bin/bash
R CMD BATCH test.r
How to fix this?