title: Running Makefile but the last file is skipped - R
body: <p>Maybe I am doing something very stupid here, but I really can't spot my mistake. Here is the Makefile:</p>
  
  <pre><code>R_OPTS=--no-save --no-restore --no-init-file --no-site-file
  
  data/clean_data.RData: R/0_clean.R data/raw_data.dta
      cd R;Rscript 0_clean.R $(R_OPTS)
  
  fig/ttest_result.pdf: R/1_1_ttest_result.R data/clean_data.RData   
      cd R;Rscript 1_1_ttest_result.R $(R_OPTS)
  </code></pre>
  
  <p>With only <code>raw_data.dta</code>, if I run <code>make</code>, the <code>clean_data.RData</code> is created but <code>ttest_result.pdf</code> is not. However, when I run <code>make fig/ttest_result.pdf</code> explicitly, the file is created. I'm really lost about why?</p>
  
  <p>Extra info: <code>1_1_ttest_result.R</code> is creating <code>ttest_result.pdf</code> with ggplot2 using <code>ggsave()</code></p>