Rscript + PHP exec () command against rapache

Let's say I want to have a simple web application that requires some user input, performs a quick calculation in some predefined R script, and returns some cool graphics object with ggplot. One way to do this:

  • Ask PHP to accept some data from the web form
  • Sanitize user login in PHP
  • Send arguments to some pre-written R script using some combination of the PHP exec () command and Rscript
  • R performs some calculations and stores the graph of the graph on the server, as well as some meta-information in the MySQL database.
  • The client can then access their new new graphics from their web browser.

It seems pretty straightforward to me. So my question is, what benefits would the rapache package have in the process described?

+4
source share
1 answer

First off, Rapache is not a package. It is an apache module and a set of conventions, really a system for creating web applications written in R ...

The advantage is speed. The downside is that you have to write a bunch of R code. Some may disagree with me on this.

+4
source

All Articles