RSetVarSerialized()

Serializes the content of the passed parameter into a variable.

Synopsis

RSetVarSerialized ( const string var, const blob& val, int userData= 0);

Parameters

Parameter Description
var The variable contains the serialized data.
val A blob variable that contains the data to be serialized.
userData User data of the function call. The user data variable can be set to an integer value and be used to detect errors when calling R functions. Set the variable to an integer value and when the function is called and an error occurs, the specified integer value is returned.

Return Value

-

Description

Serializes the content of the passed parameter into the variable "conststring&var".

Example

The example serializes the variable " b1". First the function "RGetVarSerialized" returns the right data type (a blob).

#uses "CtrlR"
main()
{
  DebugN("RSetVarSerialized");
  dyn_int var = makeDynInt(1,2,3,4,6,7,8);
  RSetVar("v1", var);
  blob b1 = RGetVarSerialized("v1"); /*returns a blob "b1" that can be serialized via the function RSetVarSerialized */
  DebugN("Variable to be serialized", b1);
  RSetVarSerialized("v2", b1);
  DebugN("The serialized variable:",RGetVar("v2"));
}

Assignment

R Functions

Availability

R Control Extension

See also

RPredict(), RRandomForest_Train(), RLoadModel(), REvalExp()