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.)

Note: The APIs do not include methods for serializing or deserializing binary objects. These tasks require using either the TERR engine or the open-source R engine.

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.

Note: If you are using the Spotfire Statistics Services Java or C# API to send data through Spotfire Statistics Services, you must limit the data to a size that can be sent using SPXML. If the data exceeds the allowed size of 512,000 bytes, the API throws an exception.

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.