Set and get R variables (including matrices)

The two methods implementing set and get variable to/from R are SetSym(<VarName>,<VarValue>) and GetSym(<VarName>).
The first one returns nothing, second one returns the variable value. The second method could be replaced by Eval(<VarName>).

For the purpose of these example Rp tool board must be loaded.


Example 1

Objective: Set variable "a" to 6, and get the same variable in result field.


Example 2

Objective: Set variable "z" to the matrix from dt1 data board, and get the same variable into another data board.

 


Example 3

Objective: Set Sicyon variables "a" and "d" to R, and get the variable "d" to result field.


Example 4

Objective: Copy Sicyon variables "a" and the matrix "dt8" from Sicyon to R and then get the last one in result field.

Similar to the example 3 above but using matrices: dt8 is control data board for Sicyon and CopySVars makes a copy of it in R.


Back to Top