{"id":34054,"date":"2017-12-12T08:56:45","date_gmt":"2017-12-12T00:56:45","guid":{"rendered":"http:\/\/localhost\/help\/?page_id=34054"},"modified":"2024-08-15T11:16:35","modified_gmt":"2024-08-15T03:16:35","slug":"configuring-the-r-adaptor","status":"publish","type":"page","link":"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/server-resources\/configuring-the-r-adaptor\/","title":{"rendered":"Configuring the R Adaptor"},"content":{"rendered":"\n<p class=\"left-bar\">This article applies to IFS OI Explorer version 4.17.0 and IFS OI Sentinel 4.17.0, and later.<\/p>\n<p class=\"intro-text\">The <a href=\"https:\/\/www.r-project.org\/about.html\">R Language<\/a> infrastructure is available as a separate licensable component in IFS OI Server. R is an open source programming language and software environment for statistical computing and graphics that is supported by the <a href=\"https:\/\/www.r-project.org\/foundation\/\"><em>R Foundation for Statistical Computing<\/em><\/a>.<\/p>\n<p class=\"note\">Note: Before you can use the R Script component, ensure that\u00a0<strong>Microsoft R Open 3.3.3 or R.NET<\/strong>\u00a0is installed on the same machine as IFS OI Server.<\/p>\n<p class=\"intro-text\">IFS OI Server provides access to R via the R Language <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/\">calculation<\/a> functions.<\/p>\n<p class=\"left-bar\">Related: <a href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/calculations\/rtimeseries\/\">RTimeSeries<\/a>()<\/p>\n<h2>Adaptor Overview<\/h2>\n<p class=\"intro-text\">The R Adaptor is responsible for executing R scripts for the R Language functions. This adaptor supports 64-bit R engines and allows parallel R script execution by running multiple R adaptors at once with one R engine instance in each.<\/p>\n<p class=\"intro-text\">The R Adaptor differs from other adaptors in that it does not appear in IFS OI Server Management. Configuring the R Adaptor is done through the <strong>ServerConfig.xml<\/strong>, available at:<br \/>\n<em>C:\\Program Files\\P2 Energy Solutions\\P2 Server\\Configuration<\/em><\/p>\n<p class=\"intro-text\">Here is an example configuration:<\/p>\n<pre class=\"lang:xhtml decode:true \" title=\"R Adaptor\">&lt;ConfigGroup Name=\"R Adaptor\"&gt;\r\n     &lt;Param Key=\"RHome\" Value=\"C:\\Program Files\\Microsoft\\R Open\\R-3.4.0\" \/&gt;\r\n     &lt;Param Key=\"RRelativePath\" Value=\"bin\\x64\" \/&gt;\r\n     &lt;Param Key=\"RAdaptorEnabled\" Value=\"false\" \/&gt;\r\n     &lt;Param Key=\"RAdaptorMinPoolSize\" Value=\"2\" \/&gt;\r\n     &lt;Param Key=\"RAdaptorMaxPoolSize\" Value=\"8\" \/&gt;\r\n     &lt;Param Key=\"RAdaptorInitTimeout\" Value=\"60\" \/&gt;\r\n     &lt;Param Key=\"RAdaptorRequestTimeout\" Value=\"600\" \/&gt;\r\n     &lt;CollectionParam Key=\"RAdaptorEnabledPackages\"&gt;\r\n        &lt;Value&gt;Package1Name&lt;\/Value&gt;\r\n        &lt;Value&gt;Package2Name&lt;\/Value&gt;\r\n     &lt;\/CollectionParam&gt;\r\n     &lt;CollectionParam Key=\"RAdaptorDisabledFunctions\"&gt;\r\n        &lt;Value&gt;Function1Name&lt;\/Value&gt;\r\n        &lt;Value&gt;Function2Name&lt;\/Value&gt;\r\n     &lt;\/CollectionParam&gt;\r\n&lt;\/ConfigGroup&gt;<\/pre>\n<h2 class=\"page-subheading\">Parameters<\/h2>\n<table>\n<tbody>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\" width=\"120\"><strong>RHome<\/strong><\/td>\n<td>Main folder of the R installation.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RRelativePath<\/strong><\/td>\n<td>Relative path of the R engine within the RHome folder.<\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorEnabled<\/strong><\/td>\n<td><strong>True<\/strong> or <strong>False<\/strong>. Indicates whether the R Adaptor and thus executing R scripts is enabled. Default: <em>false<\/em><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorMinPoolSize<\/strong><\/td>\n<td>The smallest number of R Adaptor instances that will always be available to execute R scripts. Default: <em>2<\/em><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorMaxPoolSize<\/strong><\/td>\n<td>Largest number of R scripts that the system will attempt to execute simultaneously. Default: <em>8<\/em><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorInitTimeout<\/strong><\/td>\n<td>Time limit (in seconds) allowed for the R Adaptor to initially set up and configure the R engine before timing out. Default: <em>60<\/em><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorRequestTimeout<\/strong><\/td>\n<td>Time limit (in seconds) applied to all non-initialization operations against the R Adaptor. Default: <em>600<\/em><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorDisabledFunctions<\/strong><\/td>\n<td>A collection of additional R functions which are not allowed to be executed in R scripts. The following functions are considered insecure and are already permanently disabled in the R Adaptor: detach(), eval(), file.remove(), install.packages(), library(), require(), shell(), source(), system(), system2(), and unlink().\u00a0If there are no additional values in the collection, use:<br \/>\n<span class=\"code-fragment\">&lt;CollectionParam Key=\"RAdaptorDisabledFunctions\"\/&gt;<\/span><br \/>\nor<br \/>\n<span class=\"code-fragment\">&lt;CollectionParam Key=\"RAdaptorDisabledFunctions\"&gt;&lt;\/CollectionParam&gt;<\/span><\/td>\n<\/tr>\n<tr style=\"border: 1px solid #cccccc;\">\n<td style=\"padding-left: 5px;\"><strong>RAdaptorEnabledPackages<\/strong><\/td>\n<td>A collection of R packages which will be pre-loaded by the R Adaptor for executing R scripts. If a package is not in this list then it cannot be used inside an R expression. See <a href=\"#Installing_New_Packages\">Installing New Packages<\/a> below. If there are no values in the collection, use\u00a0<br \/>\n<span class=\"code-fragment\">&lt;CollectionParam Key=\"RAdaptorEnabledPackages\"\/&gt;<\/span><br \/>\nor<br \/>\n<span class=\"code-fragment\">&lt;CollectionParam Key=\"RAdaptorEnabledPackages\"&gt;&lt;\/CollectionParam&gt;<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 class=\"page-subheading\">Installing New Packages<\/h2>\n<p class=\"intro-text\">New packages cannot be installed from inside of IFS OI Explorer, and must be installed by the system administrator using the standard R installation functions.\u00a0 This has been restricted inside of Explorer so that System Administrators retaiin full control over what R Packages get installed onto the system.<\/p>\n<p class=\"intro-text\">To install new packages:<\/p>\n<ol class=\"intro-text\">\n<li>Download and install the R package onto the IFS OI Server machine.<\/li>\n<li>Add the name of the new package to the <strong>RAdaptorEnabledPackages<\/strong> This will ensure that the R adaptor will load and allow the new R package to be used.<\/li>\n<li>Restart the Data Broker Windows service to force the R adaptor to pick up the changes.<\/li>\n<\/ol>\n<hr \/>\n<h2 class=\"page-subheading\">Release History<\/h2>\n<ul class=\"intro-text\">\n<li>R Adaptor 4.17.0\n<ul class=\"intro-text\">\n<li>Added support the latest version of R.NET, up to R 4.4.0<\/li>\n<\/ul>\n<\/li>\n<li>R Adaptor 4.5.4\n<ul class=\"intro-text\">\n<li>Initial release<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The R Language infrastructure is available as a separate licensable component for IFS OI Server. This article explains how to configure the R adaptor in order to execute R scripts for the R Language calculation functions. <\/p>\n<p class=\"continue-reading-button\"> <a class=\"continue-reading-link\" href=\"https:\/\/oihelp.corporate.ifs.com\/help\/p2-server\/server-resources\/configuring-the-r-adaptor\/\">Read more<i class=\"crycon-right-dir\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":34055,"parent":3655,"menu_order":12,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[11],"tags":[98,670],"class_list":["post-34054","page","type-page","status-publish","has-post-thumbnail","hentry","category-tutorial","tag-adaptors","tag-r-language","Version-4-5-4","Product-srv"],"_links":{"self":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/34054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/comments?post=34054"}],"version-history":[{"count":8,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/34054\/revisions"}],"predecessor-version":[{"id":68504,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/34054\/revisions\/68504"}],"up":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/pages\/3655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media\/34055"}],"wp:attachment":[{"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/media?parent=34054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/categories?post=34054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oihelp.corporate.ifs.com\/help\/wp-json\/wp\/v2\/tags?post=34054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}