title: Running R commands using a bash script
body: <p>I have the  commands below that I use to make plots in R. The main text file is cross_correlation.csv. </p>
  
  <p>How can I put it in bash script so that when I launch it on the terminal, the R commands will  perform their jobs and finish (like all other shell scripts).</p>
  
  <pre><code>cross_correlation &lt;- read.table(file.choose(), header=F, sep="\t")
  
  barplot(cross_correlation$V3)
  dev.copy(png,"cc.png",width=8,height=6,units="in",res=100)
  dev.off()
  
  hist(cross_correlation$V3, breaks=15, prob=T)
  dev.copy(png,"hist_cc.png",width=8,height=6,units="in",res=100)
  dev.off()
  </code></pre>