When I submit R Code via JSL, the R console standard output (stdout) displays in the JMP log. Is there a way to capture that information in a text string? I know I can redirect the stdout from R to a file (using the sink() function) and then get the file contents in a JMP variable with some JSL, but I'd rather not have to use an intermediate step like that.
Example;
names default to here(1);
R Init();
dt=open("$SAMPLE_DATA/Cars.jmp");
R Send(dt);
R Submit(
"
summary(lm(formula=Chest.decel ~ Wt, data=dt))
"
);
RTerm();
This output shows in the log file
Call:
lm(formula = Chest.decel ~ Wt, data = dt)
Residuals:
Min 1Q Median 3Q Max
-17.931 -6.650 -1.482 5.593 44.232
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.853e+01 2.440e+00 15.792 < 2e-16 ***
Wt 3.354e-03 8.135e-04 4.123 4.7e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.367 on 339 degrees of freedom
(11 observations deleted due to missingness)
Multiple R-squared: 0.04776, Adjusted R-squared: 0.04495
F-statistic: 17 on 1 and 339 DF, p-value: 4.703e-05
I want to be able to get the output as a text string and put that into a Text Box in a report window.