<?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: Using Nested R Functions with Qlik Sense Extension, R, and Open CPU Integration Approach with Open CPU Defaults? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Nested-R-Functions-with-Qlik-Sense-Extension-R-and-Open/m-p/1117644#M5123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a function summary.lm (look at &lt;A href="https://public.opencpu.org/ocpu/library/stats/R/" title="https://public.opencpu.org/ocpu/library/stats/R/"&gt;https://public.opencpu.org/ocpu/library/stats/R/&lt;/A&gt;). This can be called with the result of the lm function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.opencpu.org/jslib.html#lib-function" title="https://www.opencpu.org/jslib.html#lib-function"&gt;OpenCPU - JavaScript Client&lt;/A&gt;‌ explains how to combine function calls by sending the session key of the first function call (lm) to the summary.lm function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;var req1 = ocpu.call("rnorm", {n: 100}, function(session1){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var req2 = ocpu.call("var", {x : session1}, function(session2){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session2.getObject(function(data){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Variance equals: " + data);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Sep 2017 11:40:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-09-21T11:40:43Z</dc:date>
    <item>
      <title>Using Nested R Functions with Qlik Sense Extension, R, and Open CPU Integration Approach with Open CPU Defaults?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Nested-R-Functions-with-Qlik-Sense-Extension-R-and-Open/m-p/1117643#M5122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, as someone with a fair amount of R experience who is brand new to Qlik, I was very excited to find some of the work that has been done to create Qlik Sense Extensions that use R's capabilities via Open CPU:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/nodtvedt/qlik-sense-r-regression-extension" title="https://github.com/nodtvedt/qlik-sense-r-regression-extension"&gt;GitHub - nodtvedt/qlik-sense-r-regression-extension: Simple proof of concept Qlik Sense Extension to connect a Qlik Sens…&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/aasensior/sense-r" title="https://github.com/aasensior/sense-r"&gt;GitHub - aasensior/sense-r: Functional examples on integrating Qlik Sense and R&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I am struggling to figure out how to use some basic R commands in this setup because I will have to use the &lt;A href="https://public.opencpu.org/ocpu/library/"&gt;default Open CPU R packages&lt;/A&gt; and so cannot create custom R functions as in &lt;A href="https://github.com/aasensior/sense-r" title="https://github.com/aasensior/sense-r"&gt;GitHub - aasensior/sense-r: Functional examples on integrating Qlik Sense and R&lt;/A&gt;&lt;SPAN style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 1.5em;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, how would one return the R console output for the &lt;EM&gt;summary&lt;/EM&gt; (to see significance levels and more) of a linear regression object in this setup?&amp;nbsp; In R, using the packaged "cars" dataset, that might be done with "summary(lm(cars$speed~cars$dist))".&amp;nbsp; However, I am not sure how to nest the "lm" function within the "summary" function, especially when the "summary" function is found in &lt;A href="https://public.opencpu.org/ocpu/library/base/R/" title="https://public.opencpu.org/ocpu/library/base/R/"&gt;https://public.opencpu.org/ocpu/library/base/R/&lt;/A&gt; and "lm" in &lt;A href="https://public.opencpu.org/ocpu/library/stats/R/" title="https://public.opencpu.org/ocpu/library/stats/R/"&gt;https://public.opencpu.org/ocpu/library/stats/R/&lt;/A&gt;‌&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function "lm" alone is used around line 69 in &lt;A href="https://raw.githubusercontent.com/nodtvedt/qlik-sense-r-regression-extension/master/qlik-sense-r-regression-extension.js" title="https://raw.githubusercontent.com/nodtvedt/qlik-sense-r-regression-extension/master/qlik-sense-r-regression-extension.js"&gt;https://raw.githubusercontent.com/nodtvedt/qlik-sense-r-regression-extension/master/qlik-sense-r-regression-extension.js&lt;/A&gt;‌&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would that script need to be changed to return the summary of the linear regression object instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These may be beginner questions, but any help would be greatly appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jun 2016 21:12:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Nested-R-Functions-with-Qlik-Sense-Extension-R-and-Open/m-p/1117643#M5122</guid>
      <dc:creator />
      <dc:date>2016-06-02T21:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using Nested R Functions with Qlik Sense Extension, R, and Open CPU Integration Approach with Open CPU Defaults?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Nested-R-Functions-with-Qlik-Sense-Extension-R-and-Open/m-p/1117644#M5123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a function summary.lm (look at &lt;A href="https://public.opencpu.org/ocpu/library/stats/R/" title="https://public.opencpu.org/ocpu/library/stats/R/"&gt;https://public.opencpu.org/ocpu/library/stats/R/&lt;/A&gt;). This can be called with the result of the lm function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.opencpu.org/jslib.html#lib-function" title="https://www.opencpu.org/jslib.html#lib-function"&gt;OpenCPU - JavaScript Client&lt;/A&gt;‌ explains how to combine function calls by sending the session key of the first function call (lm) to the summary.lm function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;var req1 = ocpu.call("rnorm", {n: 100}, function(session1){
&amp;nbsp;&amp;nbsp;&amp;nbsp; var req2 = ocpu.call("var", {x : session1}, function(session2){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session2.getObject(function(data){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("Variance equals: " + data);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
});
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Sep 2017 11:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Using-Nested-R-Functions-with-Qlik-Sense-Extension-R-and-Open/m-p/1117644#M5123</guid>
      <dc:creator />
      <dc:date>2017-09-21T11:40:43Z</dc:date>
    </item>
  </channel>
</rss>

