Rserve

Rserve is a TCP/IP server which allows other programs to use facilities of R (see www.r-project.org) from various languages without the need to initialize R or link against R library. Every connection has a separate workspace and working directory. Client-side implementations are available for popular languages such as C/C++, PHP and Java. Rserve supports remote connection, authentication and file transfer. Typical use is to integrate R backend for computation of statstical models, plots etc. in other applications.

d now contains 10 random samples from the N(0,1) distribution if there is a runing Rserve on the local machine. The RConnection doesn't have to be created more than once for subsequent commands (however, each thread must have its own connection object unless synchronized explicitly).

As a side note - if you are looking just for a way to access R from Java in one application without the need for the client/server concept, you may want to have a look at JRI. It uses JNI to link R directly into Java.

The original Rserve paper is available in the DSC-2003 proceedings. Please cite that paper when using Rserve.

NOTE: Rserve is perfect as a back-end for web services and is often used that way. See also FastRWeb.

Rserve 1.8-0 released on RForge.net. We are currently restricting the 1.8 series to RForge releases (i.e., CRAN still has 1.7) because some applications may rely on control commands which are currently unsupported in the 1.8 series due to a large overhaul of the communication between the master server and the sessions. All other features are considered stable in the 1.8 series. If you don't require control commands (or don't know what it is) then we strongly recommend installing the latest 1.8 version.

2013/08/21

Rserve 1.7-3 released. This relase now restores Windows support (thanks to David Champagne from Revolution Analytics!), it allows HTTPS to WebSockets/TLS upgrade (on unix) and cleans up configuration of the various new possible server configurations.

2013/08/12

Rserve 1.7-2 released. New keep.alive option and bugfixes

2013/07/02

Rserve 1.7-1 is now officially on CRAN. Please see the NEWS for the long list of new features in the new 1.x series. Note that the old Java client has been removed entirely and the REngine-based client now ships in the src/clients/java directory of the source package and the JAR files are even installed in the java directory of the resulting package installation.Also note that the source repository is now hosted on GitHub - builds and everything else is still performed by RForge.net.

2012/12/10

Rserve 1.7-0 is the latest version of Rserve with many new features. Please give it a go - we think it's stable enough. The only reason why it has not been officially released yet is that it currently doesn't support Windows (because many of the new features rely on things lacking in Windows). However, given that it is much more sensible to use unix servers for Rserve deployment (Windows' performance is simply too poor for any server deployment) the majority of users should be able to test the new version and give us feedback.

2012/02/20

Rserve 0.6-8 released. Added support for self-control commands as well as RSserverEval(), RSserverSource and control version of RSshutdown.

2012/01/22

Rserve 0.6-7 released. This is a security update, if you rely on the built-in authentication, make sure you update at least to this version!

2011/12/10

Rserve 0.6-6 released (bugfixes and added support for assigning pure S4 objects)

Rserve 0.5-0 was released on CRAN. This is a new, major release of Rserve which requires updated client support, because the protocol was substantially changed. It also features a new, efficient R client. Note that the old Java API (JRclient) will no longer be activaley maintained and projects are encouraged to use the new Java API (REngine). This version was in RC stage for quite a long while so hopefully most project switched already. (0.4 versions are still available from RForge for legacy projects, but not from CRAN)

2007/03/15

Rserve and its documentation have now officially moved to RForge.

2006/11/15

Rserve is now available as a package from CRAN. This also implies that the latest binary versions (both for Windows and Mac OS X) are now available from CRAN. Simply use install.packages("Rserve").

2006/05/03

Rserve_0.4-3 released including Windows binary for R 2.3.0. The new 0.4 series supports sessions, i.e. the client can detach from the server and attach to the same session later on (e.g. when the computation has finished). The corresponding new client is now available for download. Also the C++ client has been extended to support authentication and file transfer.

2005/01/12

Rserve_0.3-16 released. It allows custom initialization such that you can pre-load data and libraries, allowing even faster responses for specific tasks.

2003/10/08

Rserve_0.3-0 and updated Java client released (clients update necessary). Updated FAQ. Updated Windows binary. This version adds support for large data - if you experienced crashes while fetching large data in 0.2 and earlier, use this version instead.

automatic type conversion - most R data types are converted into native data types, e.g. the result of rnorm(10) will be double[10] in C/Java. Java client also provides classes for new R types such as RBool, RList etc.

persistent - each connection has its own namespace and working directory. Every object you create is persistent until the connection is closed. The client doesn't have to fetch or store intermediate results.

client independence - since the client is not linked to R there are no threading issues like in RSJava etc.

security - Rserve provides some basic security by supporting encrypted user/password authentication with server challenge. Rserve can be also configured to accept local connections only.

file transfer - the Rserve protocol allows to transfer files between the client and the server. This way Rserve can be used as a remote server even for task such as generating plot images etc.

configurable - one configuration file is used to control settings and to enable/disable features such as authorization, remote access or file transfer.

What Rserve is NOT

Rserve provides no callback functionality. Your application could implement callbacks via TCP/IP and the R sockets but it is not a part of Rserve.(Note: callbacks are now supported using OOB commands in OCAP mode)

Rserve is not a telnet frontend to R. The printed output is not transported (except via capture.output). Rserve uses binary protocol for transport of objects for better speed.(Note: in OCAP mode console I/O is now supported)

Rserve is thread safe across connections, but eval methods are not thread safe within one connection. This means that multiple threads should not use the same connection unless they guarantee that no eval calls are run in parallel.

You can read more about the Rserve in the documentation section. Once you read at least the introduction, you can go to the download section to get the necessary files.

Rserve was developed by Simon Urbanek, but anyone interested is welcome to check out the developer section and contribute to the project. The sources are licensed under GPL.