[R] Running Shell Script with R

jp134711 johnandrewpura at gmail.com
Mon Nov 28 17:10:01 CET 2011


I'm having some trouble getting my shell script to work. I've checked out the
Intro to R Manual and a host of other websites, but I still can't get the
script to work when I submit the job to the cluster.

Here is my main R code:

##Load Libraries
##...

## Load Time Data
Args <- commandArgs(trailingOnly = TRUE);
print(Args);
timeDat <- read.flowSet(files=NULL, path=Args[1]);
save(timeDat,file = Args[2]);

Here is my shell script file


#!/bin/bash
#$ -cwd
#$ -q all.q

R --slave --vanilla --file="/home/jpura/Desktop/FDA_Trial_Data/testscript.R"
--args "/home/jpura/Desktop/FDA_Trial_Data/Experiment_1/"
"/home/jpura/Desktop/FDA_Trial_Data/testscript.RData"

It runs just fine (i.e. I get the right output file, which is
testscript.RData) when I type the lines in the shell script file directly
into the command prompt. However, when I try to submit the file using:

qsub "path/to/testscript.sh", I don't get the desired output file.

Any insights to this is be greatly appreciated.

Thanks,
John


--
View this message in context: http://r.789695.n4.nabble.com/Running-Shell-Script-with-R-tp4115734p4115734.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list