Learn R Programming

XR (version 0.7.2)

asServerObject: Generate a Server Language Expression corresponding to an R Object

Description

Returns a string that can be inserted into a server language expression. When parsed and evaluated by the server evaluator, the result will be the appropriate object or data.

Usage

asServerObject(object, prototype)

# S4 method for name asServerObject(object, prototype)

# S4 method for AssignedProxy asServerObject(object, prototype)

# S4 method for ProxyFunction asServerObject(object, prototype)

# S4 method for ProxyClassObject asServerObject(object, prototype)

Arguments

object

The R object.

prototype

The proxy for a prototype of the server language object wanted. When called from the `AsServerObject()` method of an evaluator, this argument is supplied automatically from a class of objects for that evaluator, allowing methods to be defined specialized to the various interface evalutor classes.

Methods (by class)

  • name: class "name" is used to pass unquoted strings, in case your interface code did an explicit assign (but that's discouraged).

  • AssignedProxy: Proxy objects are just passed as their character string, although a particular interface class could do something different, like refer to a table.

  • ProxyFunction: a proxy function just turns into its server language name.

  • ProxyClassObject: an object from a proxy class will be replaced by the name of the referenced object

Details

Methods for proxy objects and proxy class objects will produce the name under which they were assigned. The default method uses JSON to encode the object as a string and expects the server side interface to have a function objectFromJSON() to decode the string.

References

Chambers, John M. (2016) Extending R, Chapman & Hall/CRC. ( Chapter 13, discussing this package, is included in the package: ../doc/Chapter_XR.pdf.)