Table 13.3 shows what JMP data types can be exchanged with R using the R Send( ) function. Sending lists to R recursively examines each element of the list and sends each base JMP data type. Nested lists are supported.
R Init();
X = 1;
R Send( X );
S = "Report Title";
R Send( S );
M = [1 2 3, 4 5 6, 7 8 9];
R Send( M );
R Submit"
X
S
M
);
R Term();
Table 13.4 shows what JMP data types can be exchanged with R using the R Get() function. Getting lists from R recursively examines each element of the list and sends each base R data type. Nested lists are supported.
A JMP object sent to R using R Send() uses the same JMP reference as the name of the R object that gets created. For example, sending the JMP variable dt to R creates an R object named dt. The colon and double colon scoping operators (: and ::) are not valid in R object names, so these are converted as follows:
For example, sending nsref:dt to R creates a corresponding R object named nsref.dt.
For example, sending ::dt to R creates a corresponding R object named dt.
The R Name() option to R Send() has an argument that is a quoted string that contains a valid R object name. The JMP object sent to R becomes an R object with the name specified. For example:
R Send( jmp_var_name, R Name( "r_var_name") );
R Submit( "print(r_var_name)" )
This example creates a variable x in the Here namespace, a variable y in the global namespace, and a variable z that is not explicitly referenced to any namespace. The variable z defaults to Global unless Names Default To Here(1) is on. These variables are then passed to R.
Here:x = 1;
::y = 2;
z = 3;
 
R Init(); // Initiate the R connection
 
R Send( Here:x );
/* Send the Here variable to R.
Here:x creates the R object Here.x */
R Submit( "print(Here.x)" );
/* Note that the JMP log labels the output with the original JMP variable reference Here:x. */
 
R Send( ::y ); // ::y creates the R object y
R Submit( "print(y)" );
 
R Send( Here:x, R Name( "localx" ) );
// To use a different name for the R object, use the R Name() option
R Submit( "print(localx)" );
/* The R Name option to the R Send() command creates the R object named "localx"" corresponding to the JMP variable "Here:x". Again the log shows the original corresponding JMP variable name. */
 
R Send( z ); // z creates the R object z
R Submit( "print(z)" );

Help created on 10/11/2018