Knime R issue

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?

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

R 3.5 - macOSX problems

RServe compilation

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


produces output:

[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”:

| Row ID | Col1 | Col2 |

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

| Row ID |

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

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.

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

kn_example_r_empty_columns.knwf (213.9 KB)

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

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).

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?

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 data containing rows, otherwise it would create an error message.

kn_example_r_empty_columns.knwf (267.9 KB)

1 Like

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

1 Like

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.


I was working with 3.3.3 version of knime.

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.



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.