Package R.rsp

An R Server Page (RSP) is a document that contains both text in a format of choice (HTML, TeX, ...) as well as R source code within special tags. An RSP file can be translated into a so called R servlet, which is an R script that outputs the final document when sourced. This way documents in any format can be generated dynamically using R, e.g. automatic reports of statistical analysis. Utilizing an internal cross-platform web server, this package provides dynamic help pages in HTML. If other packages provide RSP help pages, these are automatically linked to in the RSP main menu. For package history, see showHistory(R.rsp).


This is a cross-platform package implemented in plain R. This package depends on the packages R.oo [1] and R.utils. Note that no webserver is required to process RSP documents.


To install this package, do install.packages("R.rsp").

To get started

To get started, see:

  1. rspToHtml() - To compile an RSP file to HTML.
  2. browseRsp() - To start the internalRweb server and launch the RSP main menu in the default web browser. From this page you access not only help pages and demos on how to use RSP, but also other package RSP pages.
  3. sourceRsp() - To process a single RSP page.
  4. sourceAllRsp() - To process multiple RSP pages in a batch.
  5. parseRsp() - To parse an RSP page in to R code, but without evaluating the code.
  6. HttpDaemon- The internal web server.


Here is a list of features that would be useful, but which I have too little time to add myself. Contributions are appreciated.

  • Extract the HTTP daemon part of this package and create a standalone package named R.httpd or similar. It should provide a method to register simple modules, such as an RSP module. The R.rsp package should then only be a simple module.
  • Write "plugins" to common web servers, e.g. modules to the Apache webserver.
  • Add support for multiple default files; needs Tcl coding.
  • Create a root ServletRequest class to support not only HTTP requests, but also other types of request, e.g. FileRequest etc. This requires some thinking of user cases and design.
If you consider implement some of the above, make sure it is not already implemented by downloading the latest "devel" version!


The releases of this package is licensed under LGPL version 2.1 or newer. The development code of the packages is under a private licence (where applicable) and patches sent to the author fall under the latter license, but will be, if incorporated, released under the "release" license above.

How to cite this package

Not available.


[1] H. Bengtsson, The R.oo package - Object-Oriented Programming with References Using Standard R Code, In Kurt Hornik, Friedrich Leisch and Achim Zeileis, editors, Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20-22, Vienna, Austria. http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/

  • R.rsp-package
  • R.rsp
Documentation reproduced from package R.rsp, version 0.4.1, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.