<?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 R code in SAS Enterprise Miner in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394413#M6001</link>
    <description>&lt;P&gt;Did you check the other links in the note? I found information relating to your questions. Also the EM Reference Manual has some useful stuff in the Open Source Code Node chapter 72:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/onlinedoc/miner/em132/emref.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/miner/em132/emref.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 09 Sep 2017 05:33:02 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2017-09-09T05:33:02Z</dc:date>
    <item>
      <title>Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394341#M5998</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In SAS Enterprise Miner, I would like to use R Code with the Open Source Integration Node.&lt;BR /&gt;&lt;BR /&gt;I need to load the DMwR library from R in order to perform SMOTE sampling.&lt;BR /&gt;&lt;BR /&gt;The node runs without error but the library has not been found.&lt;BR /&gt;&lt;BR /&gt;Someone told me that I have to install R on the SAS Server. Do you know how I could install it on the server and then make use of the library ?&lt;BR /&gt;&lt;BR /&gt;Thank you for your help,&lt;BR /&gt;Marco</description>
      <pubDate>Fri, 08 Sep 2017 20:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394341#M5998</guid>
      <dc:creator>mmaccora</dc:creator>
      <dc:date>2017-09-08T20:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394389#M5999</link>
      <description>&lt;P&gt;This SAS note should help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/54/806.html" target="_blank"&gt;http://support.sas.com/kb/54/806.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2017 02:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394389#M5999</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-09T02:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394410#M6000</link>
      <description>Thank you, I already had seen the proposed page. There is no answer to my problem in it.</description>
      <pubDate>Sat, 09 Sep 2017 05:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394410#M6000</guid>
      <dc:creator>mmaccora</dc:creator>
      <dc:date>2017-09-09T05:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394413#M6001</link>
      <description>&lt;P&gt;Did you check the other links in the note? I found information relating to your questions. Also the EM Reference Manual has some useful stuff in the Open Source Code Node chapter 72:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/onlinedoc/miner/em132/emref.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/miner/em132/emref.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2017 05:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394413#M6001</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-09T05:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394425#M6002</link>
      <description>&lt;P&gt;Yes, thank you for the docs, but I could not find an answer to my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have installed the R library in the root as it is recommended in your documentation. Now, the warning message that the library could not be found disappeared. But now, the problem is that the working directory (macro _WORK_DIR) cannot be changed (see picture of the log).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know where is the correct location for installing the library and how to install it. Do you know where and the way to do it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: _WORK_DIR is set to "%sysfunc(getoption(work))"&lt;/P&gt;</description>
      <pubDate>Sat, 09 Sep 2017 08:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394425#M6002</guid>
      <dc:creator>mmaccora</dc:creator>
      <dc:date>2017-09-09T08:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394484#M6003</link>
      <description>&lt;P&gt;I've haven't installed R yet but we are looking at getting it working soon. I think you should track this problem with SAS Tech Support if you haven't done so already.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2017 02:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/394484#M6003</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-09-10T02:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using R code in SAS Enterprise Miner</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/433120#M6640</link>
      <description>&lt;P&gt;Hi mmaccora,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First let me clarify what the R working directory and workspace mean. The workspace is your current R working environment and includes any user-defined objects (vectors, matrices, data frames, lists, functions). At the end of an R session, the user can save an image of the current workspace to a location on the file system, the "working directory", and it will automatically reload the next time R is started.&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;SAS Enterprise Miner's Open Source Integration (OSI) node sets the R working directory to a temporary file, just the same as SAS creates a SAS working directory for each SAS session. These are temporary files that disappear after the session ends.&amp;nbsp;If you turn on &lt;STRONG&gt;options mprint&lt;/STRONG&gt; in the project start code and rerun the node, you will see where the OSI node sets the working directory:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;NOTE: %INCLUDE (level 1) file _RSUBMIT is file C:\Users\jemayo\AppData\Local\Temp\SAS Temporary Files\_TD18080_d10a871_\Prc2\RSUBMIT.sas.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;24560 +_WORK_DIR= "%sysfunc(getoption(work))";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;MPRINT(EM_OPEN_TRAIN): _WORK_DIR= &lt;STRONG&gt;"C:\Users\jemayo\AppData\Local\Temp\SAS Temporary Files\_TD18080_d10a871_\Prc2"&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We don't recommend changing the work directory, but if you do decide to change it, make sure you have read and write permissions to that location and the location exists.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your original question regarding installation directory and how that works:&lt;/P&gt;
&lt;P&gt;In the picture you sent in of the OSI node log, it looks like you are trying to set the working directory for R to&amp;nbsp;tell the OSI node where the libraries are located. You don't need to do this. When you install an R package, the packages install to the location you included in setwd("C:/Program Files/R/R-3.2.5/library"). After they are installed in R, you do not need to point to this location again, even in the OSI node. You simply need to call the&amp;nbsp;library you want to use. The only code you would need to put in the code editor would be:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;library(DMwR)

&amp;amp;EMR_EXPORT_TRAIN &amp;lt;- SMOTE(form = &amp;amp;EMR_CLASS_TARGET ~ &amp;amp;EMR_CLASS_INPUT + &amp;amp;EMR_NUM_INPUT, data = &amp;amp;EMR_IMPORT_DATA, perc.over = 200, k = 5, perc.under = 1000)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enterprise Miner passes the code back to R to run, and R already knows where to find these packages. Your code should run&amp;nbsp;successfully without the setwd() command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;BR /&gt;&lt;BR /&gt;Jess Mayo&lt;/P&gt;
&lt;P&gt;SAS Technical Support&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 14:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Using-R-code-in-SAS-Enterprise-Miner/m-p/433120#M6640</guid>
      <dc:creator>jemayo</dc:creator>
      <dc:date>2018-02-01T14:47:08Z</dc:date>
    </item>
  </channel>
</rss>

