Web-enabling R functions with CGI on a Mac OS X desktop
I write many R functions for my own use and for use in class. I have been making these functions available from a web page for some time, and finally decided to just post a simple example to make it easy for others to do the same. This is just an example based on the "Rcgi" package from David Firth, and for full details of using R with CGI, see http://www.omegahat.org/CGIwithR/ . Download the document on using R with CGI. It’s titled “CGIwithR: Facilities for Processing Web Forms with R”. Of course, if you don't have R at all, then download R and install it from http://www.r-project.org/ . Then use the R package manager to install the Rcgi package. You need two program files to get everything working. (a) The html file that is the web form for input data. (b) The R file, with special tags for use with the CGIwithR package. Our example will be simple, i.e., a calculator to work out the monthly payment on a standard fixed rate mortgage. The three inputs are the loan princip...