# Knime R issue

**URL:** <https://forum.knime.com/t/knime-r-issue/13042>\
**Category:** KNIME Extensions\
**Created:** [December 28, 2018, 12:14pm UTC](https://forum.knime.com/t/knime-r-issue/13042 "2018-12-28T12:14:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 28, 2018, 12:14pm UTC](https://forum.knime.com/t/knime-r-issue/13042/1 "2018-12-28T12:14:33Z")

</div>

I am facing issues with Knime 3.6 version and R  
Earlier in lower versions R snippet used to gives 0 rows, n columns (with column names) for empty dataframe but now output shows empty table, 0 rows and 0 columns.

How can I tackle this problem?

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 28, 2018, 1:27pm UTC](https://forum.knime.com/t/knime-r-issue/13042/2 "2018-12-28T13:27:53Z")

</div>

Could you provide us with some additional informations? Especially Version of R, operating system. The latest version of KNIME is 3.7 and R is 3.5.2.

Please note:

- you will need RServe 1.8.6 or larger in order for KNIME to work properly (below you find a few links about R and KNIME)
- do you use data.table or data.frame for data transfer between KNIME and R? Do you note any difference?

Or could you provide a sample workflow where this happens so we might check if we could see something.

* * *

Install R

> [@Importing R Code in Knime](https://forum.knime.com/t/importing-r-code-in-knime/11260/3):
>
> There are two basic possibilities to use R with KNIME you have a R version on your computer and you point KNIME to it (“KNIME Interactive R Statistics Integration”) KNIME provides you with an ‘integrated’ R package that sits somewhere deep in the KNIME folders (“KNIME R Statistics Integration (Windows Binaries)”) I would advise to use the first option. So first to proper install R (and maybe RStudio to have an easier handling) and then point KNIME to it. There are further R integrations but t…

R 3.5 - macOSX problems

> [@R Problems on macOS (high sierra) since R version 3.5](https://forum.knime.com/t/r-problems-on-macos-high-sierra-since-r-version-3-5/10935):
>
> I am experiencing a strange problem with R Snippets in KNIME 3.5.3 on a macOS (high sierra 10.13.4 (17E202)) system since switching to the newest R version 3.5. It seems to be there with every R Snippet I use that generates an output table, the system is not able to get back knime.out parameters and throws strange error messages. The first part using R does work so there does not seem to be a general R problem. Well yes I tried to reinstall R, I made sure I have RServe and Cairo up and running …

RServe compilation

> [@KNIME : R evaluation failed.](https://forum.knime.com/t/knime-r-evaluation-failed/12560/13):
>
> And another thing. If you have to use the newest version of RServe you will have to compile the package. On MacOS you will need the packages mentioned on the relevant R website: [https://cran.r-project.org/bin/macosx/](https://cran.r-project.org/bin/macosx/) On a windows system you will have to compile the package with the help of RTools [https://cran.r-project.org/bin/windows/base/rw-FAQ.html#Can-I-install-packages-into-libraries-in-this-version\_003f](https://cran.r-project.org/bin/windows/base/rw-FAQ.html#Can-I-install-packages-into-libraries-in-this-version_003f) I recently noted that at least when compiling the RServe package Rtools does not li…

> [@Issue with KNIME R version](https://forum.knime.com/t/issue-with-knime-r-version/12562/10):
>
> I mean the up to three KNIME extensions about R as mentioned before. I would deinstall them an install them again. Maybe first only using the “R Scripting extension” [image] From my experience the most important thing is to update RServe to the latest version (1.8-6). You will have to compile the package yourself (depending on your platform) since there is no binary version ready for download (yet). [http://www.rforge.net/Rserve/files/](http://www.rforge.net/Rserve/files/) [image] Download the .tar file and use it to install a …

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 29, 2018, 7:38am UTC](https://forum.knime.com/t/knime-r-issue/13042/3 "2018-12-29T07:38:54Z")

</div>

I tried to install the 1.8.6 version of Rserve, but there’s some error thrown…R evaluation failed memory error

My concern is:

If I have an R snippet node in Knime, which (under some circumstances) produces an empty dataframe as knime.out with some columns. E.g. dataframe called df with column names “Col1”, “Col2”, “Col3”, issuing command

```auto
knime.out

```

produces output:

```auto
[1] Col1 Col2
<0 rows> (or 0-length row.names)

```

I would accept in this case that the R snippet node’s Data Output would be an empty table with columns “Col1” and “Col2”:

```auto
------------------------
| Row ID | Col1 | Col2 |
------------------------

```

But actually the Data Output is an empty table with no columns:

```auto
----------
| Row ID |
----------

```

Earlier this was giving me proper out put. But after updating Knime I am facing this issue.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 29, 2018, 11:41am UTC](https://forum.knime.com/t/knime-r-issue/13042/4 "2018-12-29T11:41:24Z")

</div>

I can reproduce what you mean. Indeed the R Snippets behave in a strange way. Regardless if you use data.table or data.frame.

This might be an issue for KNIME support.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/5/521a1068268b67909e0f8cfeb3a41b5c46f02d2f.png)

within the R Snippet the Head(anime.out) still shows the columns although with a warning.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/e/e828746b3181ad01979ba4cfff5fd4a89d8b04ab.png)

[kn\_example\_r\_empty\_columns.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/5/52ca96a126dd04d61dd37cb48c572c331ff49f5d.knwf) (213.9 KB)

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 29, 2018, 4:23pm UTC](https://forum.knime.com/t/knime-r-issue/13042/5 "2018-12-29T16:23:21Z")

</div>

I downloaded and tried to run the sample workflow shared by you  
this is what I am getting. I am not sure what am I missing. My Knime version is 3.6.2

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/5/5f47d4a6671435a8ebe38b6e82c47a1d80ee25c5.png)

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 29, 2018, 7:08pm UTC](https://forum.knime.com/t/knime-r-issue/13042/6 "2018-12-29T19:08:12Z")

</div>

You do not miss anything. I can recreate your problem with the workflow. I informed knime support.

In the meantime you might try to use the R Snippet from the community nodes. But they need RServe set up and running in a separate instance (see R code in the right description field in the workflow).

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 30, 2018, 5:23am UTC](https://forum.knime.com/t/knime-r-issue/13042/7 "2018-12-30T05:23:18Z")

</div>

I cannot use R snippet from community node bc’z I have already created many workflows and changing them is a huge pain.

Has anyone else faced similar kind of issue?

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 30, 2018, 10:17am UTC](https://forum.knime.com/t/knime-r-issue/13042/8 "2018-12-30T10:17:29Z")

</div>

I have reported the phenomenon to the KNIME support, we have to see if they come up with a solution. Can you say what was the last version of the R scripts that did work?

I constructed a workaround which is admittedly not very elegant. I create an artificial dataset with a new variable that will be 999 for an additional row so that the dataset that comes out of the R snippet will never be empty and would contain all the columns of the original one, but you would have to filter out the artificial row regardless of the other data. Again: not very elegant. And it depend on the knime.in data containing rows, otherwise it would create an error message.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/b/bd4c22866e58f2c03f799ecf98f8e6048736fb13.png)

[kn\_example\_r\_empty\_columns.knwf](https://forum-cdn.knime.com/uploads/default/original/2X/3/343fd2efca1d39eadb12f38e1016e28a5070f4a1.knwf) (267.9 KB)

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [December 30, 2018, 2:28pm UTC](https://forum.knime.com/t/knime-r-issue/13042/9 "2018-12-30T14:28:51Z")

</div>

> [@Kumar](#):
>
> Earlier this was giving me proper out put. But after updating Knime I am facing this issue.

Hi Kumar,

in which version this did work for you? I just tried and I get the same result with KNIME 3.5.

Best, Iris

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 31, 2018, 4:41am UTC](https://forum.knime.com/t/knime-r-issue/13042/10 "2018-12-31T04:41:19Z")

</div>

Thank you for the solution, I had already thought of similar kind of solution.

But I was hoping that changing/installing some packages will help instead of changing many knime workflows.

Thanks!!

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [December 31, 2018, 4:41am UTC](https://forum.knime.com/t/knime-r-issue/13042/11 "2018-12-31T04:41:52Z")

</div>

I was working with 3.3.3 version of knime.

---

<div class="post-metadata">

**Author:** ![RolandBurger](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rolandburger/32/51868_2.png) [@RolandBurger](https://forum.knime.com/u/RolandBurger)\
**Post date:** [January 7, 2019, 1:37pm UTC](https://forum.knime.com/t/knime-r-issue/13042/12 "2019-01-07T13:37:11Z")

</div>

Hi @Kumar

Thanks for pointing this out. I have verified that the behavior was indeed different in KNIME AP 3.3. I have opened a ticket, our developers will investigate this.

Cheers,  
Roland

---

<div class="post-metadata">

**Author:** ![Kumar](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@Kumar](https://forum.knime.com/u/Kumar)\
**Post date:** [January 7, 2019, 5:58pm UTC](https://forum.knime.com/t/knime-r-issue/13042/13 "2019-01-07T17:58:35Z")

</div>

Hi @RolandBurger, Thanks for letting developers know this! I hope this will be resolved soon, although temporary solution is provided above but that’s not very trustful. There are few more issues faced using knime 3.6.2. I will post it soon.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:32pm UTC](https://forum.knime.com/t/knime-r-issue/13042/14 "2023-06-23T20:32:03Z")

</div>


