BlobToSObject
Convert Between S objects and Binary Objects
Description
Use these function to pass any S object to Spotfireand to convert
those properties back to an S object. The binary object ("blob")
is unintelligible to most of Spotfire, but it is useful for caching
information needed in a future call to a data function.
Usage
BlobToSObject(blob)
SObjectToBlob(object)
Arguments
object |
any S object.
|
blob |
a binary object created by SObjectToBlob.
|
Details
A blob created by SObjectToBlob can be passed from a data function to
Spotfire as a "value" and then passed back to another data function. For example,
you can use a blob to store a fitted model, and then pass the blob to a data
function that computes predicted values based on that fitted model and the
current data.
Only use BlobToSObject for input you know you can trust. BlobToSObject
deserializes the input and, if the input has been manipulated, the deserialization
can lead to execution of malicious code.
Value
SObjectToBlob returns a vector of class "raw".
BlobToSObject returns an S object.
Note
The format of the blob depends on the S interpreter (open-source R, TERR, and so on) and
the format can change in the future. This format is not intended to be a long-term
storage format.
Examples
fittedModel <- lm(ozone ~ radiation + temperature + wind, data=Sdatasets::air)
blob <- SObjectToBlob(fittedModel)
z <- BlobToSObject(blob)
identical(fittedModel, z)