You are here

The power of R and Apache

The statistical package R has been popular in analyzing statistical data. A derivation of an earlier commercial product called S, it is a successful open source product with a familiar GPL license. Apache is the most popular web server, serving most of the worlds web pages. It is also an open source product. What does a marriage of the two give us? RApache! RApache is an Apache module, a piece of software specifically designed to work with the Apache server. It makes it possible to process pages with R before they are shipped off to the user browser. Why should we care? Well, if you are, like me, interested in using R efficiently to put a large amount of statistical calculations on the Web, RApache is for you. Together with the RApache and brew packages written in R, we have a powerful Web Application framework. We can author pages in HTML, with special custom tags that contain R code. Thus, we may write highly interactive pages, by combining forms, menus and JavaScript GUIs together, to perform sophisticated statistical calculations and deliver an experience to the user that he grew to expect from technologies that use lower-level languages such as Java. The advantage is that R permits us to focus on the difficult part of the application right away and leverage the massive collective effort that went into the development of R. Now that you are sold on the idea, you can obtain the RApache software from the project website: A word of caution: be prepared to spend some time installing and configuring it. This will require quite a bit of technical knowledge on:

  • The architecture of the Apache web server
  • The flow of data between Apache web server and an embedded language such as R
  • Experience with Web Applications
  • Cascading Style Sheets (CSS)
  • JavaScript

This may sound like quite a bit, and it is. The good news is that there is plenty of documentation, and the examples accompanying RApache are excellent. The payoff is great. Throughout the next year (2009) you will see the content on my website grow, and much of it will be related to statistics. The interactive examples will be included, using R and Apache. The first example of this kind on this Website can be found here