3.7.5.48 R

LabTalk Object Type:

Utility Object


The R (or RObj) object provides script access for running basic R commands and exchange data with R console.

Methods:

Method Description
R.Init()

Initiate the R application.

R.Reset()

Clear all variables in current R session.

R.Exec(strCommand)

Execute one or multiple R command lines via string strCommand.

R.Send(OriginDataset, Rvariable,type)

Send Origin dataset OriginDataset to R as variable Rvariable, data type can be -1 = auto, 0 = vector, 1 = matrix, 2 = data frame.

R.Receive(OriginDataset, Rvariable, type)

Receive R variable as Origin dataset OriginDataset, data type can be -1 = auto, 0 = vector, 1 = matrix, 2 = data frame.

R.GetReal(LabTalkVar, RVariable)

Assign the numeric value of R variable RVariable to Origin variable LabTalkVar.

R.SetReal(LabTalkVar, RVariable)

Assign the numeric value of Origin variable LabTalkVar to R variable RVariable.

R.GetStr(LabTalkVar, RVariable)

Assign the string value of R string variable RVariable to Origin string variable LabTalkVar.

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

Example

Please view this page for examples.