output from R-Snippet as a table

,

Hi everyone, i needed to perform an Agostino test for normality and i solved this problem with a node r-snippet. The console output meets my needs, however I would like to have this in a table as the node output. Can someone help me?

Hi @eferro , I’m not familiar at all with R, however, it should be just a matter of redirecting the results to the output data.

Based on the code from your screenshot, I would imagine you knime.in is the input stream and knime.out is the output stream.

So, I would imagine you just need to redirect the results into knime.out, and based on the code, the syntax would probably be:
knime.out <- agostino.test(knime.in$"IDATE")

EDIT: Just taking this opportunity to reach out to you. This is your 3rd post, and in your other 2 posts, different members of the Knime Community, including me, have contributed to resolve your issues, but have not heard back from you over there. In each of the 2 posts, we have even done follow ups to see if the proposed solutions worked. It would be nice and helpful for other members if you can confirm which solution worked so that they know what solution to use if they have similar issues. That’s essentially the basis of a Community :slight_smile:

3 Likes

Hi @eferro & @bruno29a

You are both almost there, but still you need to -unlist- the agostino result and convert it to a dataframe format to be compatible with KNIME, otherwise you get an error:

The following should work as shown below:

library( moments)
htest_result <- unlist( agostino.test( knime.in$"Sepal.Length"))
knime.out <- data.frame( htest_result)

image

Hope this helps.

Best,

Ael

5 Likes

Thanks @aworker. As I said, R is not something I am familiar with. I’ve not even seen the inside of an R Snippet apart from @eferro 's screenshot :rofl:

But the general idea I wanted to put out was that the results just needed to be added to the output stream :slight_smile:

Thanks for putting out the full solution.

3 Likes

Agree. I will take care of it in future. Thanks.

2 Likes

Perfect, this solve everything. Thank you.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.