...
opts="-p batch -c 8 --mem=10000 --time=10:00:00"
while read filenm; do
outs="--output=$filenm.out --error=$filenm.err --mail-type=ALL --mail-user=$USER
echo "sbatch $opts $outs --wrap='R --no-save < $filenm'"
sleep sleep 1
done
The 'while read filenm; do' line iterates over each line passed to it, copying the line into the filenm variable.
To run this just use the cat function to pipe (pass) the file of R scripts to the bash script. Here is what would get submitted ( with your username!).
cat myfiles.lst | sh runBatchR.sh
...