asServerObject {XR} | R Documentation |
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 signature 'name'
asServerObject(object, prototype)
## S4 method for signature 'AssignedProxy'
asServerObject(object, prototype)
## S4 method for signature 'ProxyFunction'
asServerObject(object, prototype)
## S4 method for signature '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. |
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.
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
References
Chambers, John M. (2016) Extending R, Chapman & Hall/CRC. ( Chapter 13, discussing this package, is included in the package: ../doc/Chapter_XR.pdf.)