8

I am beginning work on a project that makes heavy use of R. I've used R in the past, but only in a casual mode, whereas I'm now interested in following a more rigid practice of test/source control/continuous integration. I'm hoping to use Maven with this project if possible (having been pleased with how this manages packages with Java), but I can't find any evidence that it is possible to use Maven with R. Is it possible to create an R project with Maven, and if so, where can I find steps to help me get started?

I've found this question and this question, but they don't mention R.

Community
  • 1
  • 1
Ben Hocking
  • 7,790
  • 5
  • 37
  • 52
  • 3
    This doesn't answer your question, but I will say that the management tools that I'm aware of in R are (1) the packaging mechanism (which allows for basic checks of documentation consistency, code correctness [nothing very fancy here], running examples) and (2) the `RUnit` and `svUnit` packages, which implement two different flavo(u)rs of unit testing. Otherwise I think lots of people just use `make` ... – Ben Bolker Oct 24 '11 at 20:01
  • Thanks for the information, Ben. I'm currently using `RUnit` and have been happy with it. I've used the packaging mechanism to create (`R build [pkg]`) and check (`R check [pkg]`) a simple package, but still have much to figure out there. I was unaware of `svUnit`. I'm quite familiar with `make` and it might be a fall-back position if I can't find a more robust solution. – Ben Hocking Oct 24 '11 at 20:05
  • 2
    Also note the `testthat` package with the `autotest` function that will continuous rerun tests as you change your code/tests. See also `devtools`. – hadley Oct 24 '11 at 21:13

1 Answers1

3

Well you could make use of the Maven Exec Plugin with the resource, filter and jar plugins to fake an R project type.

You can do something like this to set up multiple R goals with the exec plugin so that compile, filter, test, et al have some kind of R call associated.

http://maven.apache.org/plugins/maven-resources-plugin/

Community
  • 1
  • 1
sal
  • 23,373
  • 15
  • 66
  • 85
  • 2
    +1, I appreciate the suggestions, and these seem like reasonable approaches for projects that use Java or some other supported language and that also use R, but unfortunately, these don't seem to help me with what Maven does well - package management. (I.e., they don't do it any better than `make`.) I was hoping there would be a good solution to my problem, but given the expertise that hangs out here at StackOverflow, I'm guessing that I'm not going to get a better answer than yours. I'm still hoping though... – Ben Hocking Oct 24 '11 at 23:32