LabTalk Object Type:
The RS (RServe) object provides script access for running basic R commands and exchange data with R console through a remote server.
Method | Description |
---|---|
RS.Init(address, port, user, password) |
Initiate the Rserve application, please refer to this page for parameters setting. |
RS.Close() |
Close the Rserve application. |
RS.Exec(strCommand) |
Execute one or multiple RServe command lines via string strCommand. |
RS.Send(OriginDataset, RVariable,type) |
Send Origin dataset OriginDataset to RServe as Variable RVariable, data type can be -1 = auto, 0 = vector, 1 = matrix, 2 = data frame. |
RS.Receive(OriginDataset, RVariable) |
Receive RServe Variable as Origin dataset OriginDataset, data type can be -1 = auto, 0 = vector, 1 = matrix, 2 = data frame. |
RS.SetBufferSize(nSize) |
Set Rserve buffer size (at least 32768 (32KB)). |
RS.SetTimeout(nSeconds) |
Set the timeout in seconds optionally for connection. |
RS.GetReal(LabTalkVar, RVariable) |
Assign the numeric value of R variable RVariable to Origin variable LabTalkVar. |
RS.SetReal(LabTalkVar, RVariable) |
Assign the numeric value of Origin variable LabTalkVar to R variable RVariable. |
RS.GetStr(LabTalkVar, RVariable) |
Assign the string value of R string variable RVariable to Origin string variable LabTalkVar. |
RS.SetStr(LabTalkVar, RVariable) |
Assign the string value of Origin string variable LabTalkVar to R string variable RVariable. |
1. Logical vector FALSE,TRUE in R will be received as 0, 1, respectively in Origin worksheet. 2. Origin's missing values "--", empty cell "" will be sent to R as NA. |
Please view this page for examples.