Site icon R-bloggers

makefiles for Sweave, R and LaTeX using Eclipse on Windows

[This article was first published on Jeromy Anglim's Blog: Psychology and Statistics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
This post provides a brief introduction to make and makefiles. In particular it describes how to set up make on Windows with an emphasis on using make in Eclipse on projects involving R, Sweave, and LaTeX.

Overview

make is software that uses makefiles to build projects. make has many benefits.

make has won the ACM Software System Award. It shares this honour with two of my other favourite tools: TeX and S.

make has also encouraged me to think more about dependencies, one-click builds, and project file structures. Specifically, I use make in conjunction with R, Sweave, LaTeX, and other command line tools to build reproducible research output. I’ll post some examples in the near future.

Installation on Windows

In order to run Sweave on the command line on Windows using: R CMD Sweave foo.Rnw:

  1. Add R binaries to the Windows Path (e.g., C:\Program Files\R\R-2.11.1\bin; see here for instructions)
  2. Have Rtools installed

Introduction to R has more information about running R at the command line.

Running makefiles in Eclipse

I use Eclipse to edit R and Sweave files. To configure make in Eclipse:

Thus, with a makefile in the root directory of a project, Run - External Tools - Make runs the makefile.

Also note:

Resources for Getting Started with makefiles for Sweave

To leave a comment for the author, please follow the link and comment on their blog: Jeromy Anglim's Blog: Psychology and Statistics.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.