I am trying to run an R script.
These are some lines from my R script big2.r
dataa <- read.csv("/home/people/R2/big2.csv")
write.csv(head(dataa), file="/home/people/R2/head.csv")
when I execute R CMD BATCH big2.r
in the terminal, it gives me an .Rout file together with the head.csv.
But when I try that using my big2.sh
file by submitting the job to the queue using qsub big2.sh
It doesn't give me a .Rout file or the head.csv and the qstat for that job is C standard
and then it's gone.
This is the content of my .sh file
#!/bin/bash -l
module load R/3.2.2
R CMD BATCH big2.r
What am I doing wrong? What is the proper way to submit a job which executes an R script?
When I try #!/usr/bin/r
I get the following error.
-bash: /var/spool/torque/mom_priv/jobs/363059.sonic-head.SC: /usr/bin/r: bad interpreter: No such file or directory
I tried the solution found in Bash script: bad interpreter, but did not help.