<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get R standard output in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186459#M40478</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4467"&gt;@MathStatChem&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Before I go too far ahead, are you not wanting to use R Get() ? Did you try using R Get() and then using that information as input to the text box ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2019 16:39:42 GMT</pubDate>
    <dc:creator>uday_guntupalli</dc:creator>
    <dc:date>2019-03-12T16:39:42Z</dc:date>
    <item>
      <title>How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186450#M40477</link>
      <description>&lt;P&gt;When I submit R Code via JSL, the R console standard output (stdout) displays in the JMP log.&amp;nbsp; Is there a way to capture that information in a text string?&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This output shows in the log file&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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(&amp;gt;|t|)    
(Intercept) 3.853e+01  2.440e+00  15.792  &amp;lt; 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&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want to be able to get the output as a text string and put that into a Text Box in a report window.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:35:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186450#M40477</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2019-03-12T16:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186459#M40478</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4467"&gt;@MathStatChem&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Before I go too far ahead, are you not wanting to use R Get() ? Did you try using R Get() and then using that information as input to the text box ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 16:39:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186459#M40478</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2019-03-12T16:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186468#M40479</link>
      <description>&lt;P&gt;From what I can see, R Get() will get the values from an R data structure or variable (number, string, matrix, list, or data frame), but not the standard output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 17:01:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186468#M40479</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2019-03-12T17:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186486#M40480</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4467"&gt;@MathStatChem&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R Init();

dt=open("$SAMPLE_DATA/Cars.jmp");
R Send(dt);

R Submit(
	"
	model = lm(Chest.decel ~ Wt,data = dt)
	t = summary(model)
	
	# Use names function to determine what are the objects that exist 
	names(t)
	
	# Extract and cast into data frames 
	Residuals = as.data.frame(t$residuals)
	Coefficients = as.data.frame(t$coefficients)

	"
);

ResidJMP = R Get(Residuals);
ResidJMP &amp;lt;&amp;lt; New Data View;
CoeffJMP = R Get(Coefficients);
CoeffJMP &amp;lt;&amp;lt; New Data View;  

RTerm();

Close(dt,"No Save");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 743px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16267iBF5F1C07F8FE9960/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:18:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186486#M40480</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2019-03-12T19:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186496#M40482</link>
      <description>&lt;P&gt;Thanks for the suggestion.&amp;nbsp; &amp;nbsp;I know if I can put the R results into a R data object, then I can use R Get() to retrieve the results.&amp;nbsp; However, it would be a lot easier to just get the stdout results as a text string, at least for my purposes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4467"&gt;@MathStatChem&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;R Init();

dt=open("$SAMPLE_DATA/Cars.jmp");
R Send(dt);

R Submit(
	"
	model = lm(Chest.decel ~ Wt,data = dt)
	t = summary(model)
	
	# Use names function to determine what are the objects that exist 
	names(t)
	
	# Extract and cast into data frames 
	Residuals = as.data.frame(t$residuals)
	Coefficients = as.data.frame(t$coefficients)

	"
);

ResidJMP = R Get(Residuals);
ResidJMP &amp;lt;&amp;lt; New Data View;
CoeffJMP = R Get(Coefficients);
CoeffJMP &amp;lt;&amp;lt; New Data View;  

RTerm();

Close(dt,"No Save");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 743px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16267iBF5F1C07F8FE9960/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 19:46:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186496#M40482</guid>
      <dc:creator>MathStatChem</dc:creator>
      <dc:date>2019-03-12T19:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get R standard output</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186499#M40483</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;EM&gt;Log Capture()&lt;/EM&gt;&amp;nbsp;may do what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

R Init();

dt = Open("$SAMPLE_DATA/Cars.jmp");
R Send(dt);

R_stdout = Log Capture(R Submit("
	summary(lm(formula=Chest.decel ~ Wt, data=dt))
	"));

R Term();

New Window("example", Text Box(R_stdout));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 20:02:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-R-standard-output/m-p/186499#M40483</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-03-12T20:02:57Z</dc:date>
    </item>
  </channel>
</rss>

