<?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 call R package from Qlik in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/call-R-package-from-Qlik/m-p/1423342#M14378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have loaded several SQL tables into Qlik, now I want to input one of the table into R to do some analysis using the package I built in R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1, table2 and table3 are loaded into Qlik and are linked with each other by a common column 'CampaignID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I built a R package named 'calc_score' with only one function inside 'calculate_score(table,median_date)', and this function will return a dataframe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I tried to run this in Qlik:&lt;/P&gt;&lt;P&gt;R.ScriptEval('install.package('&lt;SPAN style="font-size: 13.3333px;"&gt;calc_score&lt;/SPAN&gt;');library('&lt;SPAN style="font-size: 13.3333px;"&gt;calc_score&lt;/SPAN&gt;') ; &lt;SPAN style="font-size: 13.3333px;"&gt;calculate_score&lt;/SPAN&gt;(table = table1 , median_date = table1$median_date $week' , [&lt;SPAN style="font-size: 13.3333px;"&gt;median_date&lt;/SPAN&gt;] as &lt;SPAN style="font-size: 13.3333px;"&gt;median_date&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but there is an error 'Internal Engine Error'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that because I cannot install package or library within the script? or is it because I need to use 'q' instead of 'table1' inside the script? but as I have three tables loaded, how can I differentiate table1$median_date and table2$median_date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Nov 2024 09:05:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T09:05:44Z</dc:date>
    <item>
      <title>call R package from Qlik</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/call-R-package-from-Qlik/m-p/1423342#M14378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have loaded several SQL tables into Qlik, now I want to input one of the table into R to do some analysis using the package I built in R&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table1, table2 and table3 are loaded into Qlik and are linked with each other by a common column 'CampaignID'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I built a R package named 'calc_score' with only one function inside 'calculate_score(table,median_date)', and this function will return a dataframe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I tried to run this in Qlik:&lt;/P&gt;&lt;P&gt;R.ScriptEval('install.package('&lt;SPAN style="font-size: 13.3333px;"&gt;calc_score&lt;/SPAN&gt;');library('&lt;SPAN style="font-size: 13.3333px;"&gt;calc_score&lt;/SPAN&gt;') ; &lt;SPAN style="font-size: 13.3333px;"&gt;calculate_score&lt;/SPAN&gt;(table = table1 , median_date = table1$median_date $week' , [&lt;SPAN style="font-size: 13.3333px;"&gt;median_date&lt;/SPAN&gt;] as &lt;SPAN style="font-size: 13.3333px;"&gt;median_date&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but there is an error 'Internal Engine Error'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that because I cannot install package or library within the script? or is it because I need to use 'q' instead of 'table1' inside the script? but as I have three tables loaded, how can I differentiate table1$median_date and table2$median_date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Nov 2024 09:05:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/call-R-package-from-Qlik/m-p/1423342#M14378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T09:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: call R package from Qlik</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/call-R-package-from-Qlik/m-p/1423343#M14379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you need to put q$median_date into you R expression. The connector will pass the data into this parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have a look at the output of the SSEtoRserver application, this provides hints as to why things are not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Nov 2017 07:25:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/call-R-package-from-Qlik/m-p/1423343#M14379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-13T07:25:23Z</dc:date>
    </item>
  </channel>
</rss>

