This guide describes how to install the KNIME Interactive R Statistics Integration to be used with KNIME Analytics Platform.
The KNIME Interactive R Statistics Integration allows to write and execute R scripts by interacting with an external R™ installation.
This integration comprises a handful of nodes which can be used to write R scripts and execute them in KNIME Analytics Platform. Besides providing the ability to read data from R into KNIME Analytics Platform, these nodes allow to manipulate data and create views using R, as well as to learn and apply models, trained in R, to the data.
These nodes can be found in the node repository under Scripting → R.
This integration, in order to communicate with R, depends on additional R packages which need to be installed. In this guide we describe how to configure the KNIME Interactive R Statistics Integration, as well as how to install R and the necessary packages.
KNIME Interactive R Statistics Integration installation
The following steps are required to install and use the KNIME Interactive R Statistics Integration.
First, install the KNIME Interactive R Statistics Integration.
In KNIME Analytics Platform, go to File → Install KNIME Extensions…. The KNIME Interactive R Statistics Integration can be found under KNIME & Extensions or by entering R integration into the search box.
Finally, configure the KNIME Interactive R Statistics Integration.
In KNIME Analytics Platform go to File → Preferences. From the list on the left, select R under KNIME and the following dialog opens:
In Path to R Home enter the path to identify the location where R is installed and click Apply to make the changes effective. This path can be found from within
The installation files as well as all the necessary information about R
installation can be found on one of the mirror sites of the Comprehensive R
Archive Network (CRAN).
R installation can be completed safely using the default settings.
The destination location where R will be installed will have to be specified in
KNIME Analytics Platform and can be found from within
R by typing
The 4.0.x versions of R are also supported.
We recommend using R via the command-line interface and to avoid using
R packages installation
Rserve is an R package that allows other applications to talk to R using
TCP/IP or local sockets sending binary requests.
It requires different installation steps and different packages depending on the
operating system in use.
Proceed with the installation of
From within R run the command:
This will install the version 1.7-3.1 of
If the library folder is not writable a warning message will appear, together with the request to use a personal library:
Warning in install.packages("Rserve") : 'lib = "C:/Program Files/R/R-3.6.3/library"' is not writable Would you like to use a personal library instead? (yes/No/cancel) yes
answer "yes" and a personal library will be installed and used.
Please test the installation with KNIME Analytics Platform and in case a problem is encountered follow the instructions at point 2.
If the procedure at point 1 did not work properly, the installation of the latest version of
Rservemight be necessary.
First, from within
R, remove any previously installed
Rserveversion running the command:
In this case, also
Rtools, a collection of tools necessary for building R packages on Windows, needs to be installed. The installer is available here. In this guide
Rtoolsis assumed to be installed under the default destination (e.g. usually
Check the box Add rtools to system PATH as shown in the above picture.
Please make sure that both
Rbin path and
Rtoolspath are added to the Windows Path variable. From the Start menu open the Control Panel and click System. In the dialog that opens, click Advanced system settings in the left column. This opens the System Properties window. Here, click Environment Variables…. Then in the System variables section click Edit… to inspect and, if required, change the variable Path. Add the paths to
Rtoolsbin folders, if they are not yet listed.
For the latest version Rtools40 the
binfolder is located in
Finally, download and install the latest version of
Rserve. From within R type the command:
GNU Fortranare needed. If they are not already installed, the installation packages can be downloaded from this link.
Another program that needs to be installed is
XQuartz, which is available for download at this link.
A script is also available that can be used to install all of the necessary packages for R integration in KNIME Analytics Platform with macOS >= 10.14. After installing the KNIME Interactive R Statistics Integration the script can be found in
KNIME/plugins/org.knime.r_<knime_version>/scripts/or at this link, only for KNIME Analytics Platform version 4.2 or higher. To allow for the execution of the script, please open a new Terminal and from the folder containing the script run
chmod u+x <name_of_the_script>.sh.
Then the R package
Rservecan be installed. Run
Rfrom Terminal and type the command:
The following error might appear when installing
*** Rserve requires R (shared or static) library. *** *** Please install R library or compile R with either --enable-R-shlib ***
If your macOS is < 10.14 (Mojave), open a new Terminal window and type the following command:
otherwise please make use of the previously mentioned script.
Now continue with installing the
Finally, the R package
Caironeeds to be installed. From within R type the command:
R from Terminal and type the command:
If the following error message appears:
/usr/bin/ld: cannot find -lssl collect2: error: ld returned 1 exit status
open a new Terminal window, type the following command:
sudo apt install libssl-dev
and continue with installing