Pass in a data object
Notice the versions of the evaluation functions in both the Function and Expression clients that take as an argument an SplusDataRequest object. This object is constructed from the Domain: it is a collection of C# or Java representations of R language objects (either TERR or open-source R) and/or an encapsulated data set (along with the ResultSerializationType property).
You can use the following option.
- If your data is not located on the server, because you do not require the evaluation request to read the data from the server repository.
- If you need to perform further analysis on results received from a previous call by passing in the resulting object.
- If you receive results from several previous requests (that is, several objects) by passing in all of the objects in an SplusDataRequest argument.
You can use these versions of the evaluation methods with either the TERR engine or the open-source R engine.
Notice that the third versions of the evaluation methods in both the Function and Expression clients accept as the input data a BinaryDataRequest object, which contains the binary version of the SplusDataRequest object (that is, an array of binary “serialized” arguments) and the serialization type. The evaluation request is sent to the server using the appropriate serialization type, where it is loaded into the engine and executed. The results are returned as an SplusDataResult object. This object contains binary serialized results, as specified by the ResultSerializationType property in the request.)
For example, you can send the object containing binary arguments to the R engine, specifying TerrSerialize, SBDF, or RSerialize as the SerializationType. Using binary serialization requires fewer computer resources (memory and CPU), because it does not have to parse the SPXML.
For more information about using the SplusDataRequest or the BinaryDataRequest object, see the help for the programming language of your choice, available from the landing page.
- Creating a binary serialization request for R using Java and rJava
The example described in this topic uses example test code in the Java API and the rJava package to demonstrate how one might build a request using the binary API.