NetWorkSpaces for R

NetWorkSpaces (NWS) provides a framework to coordinate programs written in scripting languages; NWS currently supports the languages Python, Matlab, and R. This User Guide is for the R system, and it assumes that the reader is familiar with R. An R program uses variables to communicate data from one part of the program to another. For example, 'x <- 123' assigns the value 123 to the variable named x. Later portions of the program can reference "x" to use the value 123. This mechanism is generally known as binding. In this case, the binding associates the value 123 with the name "x". The collection of name-value bindings in use by a program is often referred to as its "workspace".

Two or more R programs use NWS to communicate data by means of name-value bindings stored in a network-based workspace (a NetWorkSpace, which in R is an instance of a NetWorkSpace object). One program creates a binding, while another program reads the value the binding associated with the name. This is clearly quite similar to a traditional workspace; however, a NetWorkSpace differs from a traditional workspace in two important ways.

First, in a setting in which two or more R programs are interacting, it would not be unusual for one to attempt to "read" the value of a name before that name has been bound to a value. Rather than receiving an "unbound variable" error, the reading program (by default) simply waits ( or "blocks") until the binding occurs. Second, a common usage paradigm involves processing a sequence of values for a given name. One R program carries out a computation based on the first value, while another might carry out a computation on the second, and so on. To facilitate this paradigm, more than one value may be bound to a name in a workspace and values may be "removed" (fetch) as opposed to read (find). By default, values bound to a name are consumed in first-in-first-out (FIFO) order, but other modes are supported: last-in-first-out (LIFO), multiset (no ordering implied) and single (only the last value bound is retained). Since all its values could be removed, a name can, in fact, have no values associated with it.