R in Knime with igraph extension

Hello to everyone Knimers,

I'm writing my thesis for graduation and I'm using KNIME for business intelligence analysis.

I have almost finished my work but I have a little problem integrating R with workflow.

To view a graph created with KNIME I decided to use the extension of R igraph , but this creates problems:

 

Before starting the workflow i've just set the R server service with this: 

library(Rserve);

Rserve(args = "--vanilla")

Next, I used this sequences of nodes:

Convert to R (connected to  "Node Adjcency Matrix" node );

R Snippet with this snippet written in: 

   rOut <- kIn

   library(igraph)

  graph.adjacency(kIn, mode=c("undirected", "max",  "upper", "plus"), weighted=NULL, diag=TRUE, add.colnames=NULL, add.rownames=NA)

R Plot

When I run the Workflow it's run correctly until it's arrive in Rsnppet Node where it freeze in handle state (the progress bar just blink from a side to another).

Where is the mistake? Is that a problem with my R snippet?

Thanks in advance

Best regards

Palmieri Alessio

 

Hi,

I am not familiar with igraph but I tried some sample code from the package which works for me. I used the RView(Table) node from the R extension. Calling rserve is not necessary.  Just enter:

ibrary(igraph)

g <- make_empty_graph() + vertices(letters[1:10])
g <- g + path(letters[1:10], letters[1], color = "grey")
g <- g + edges(sample(V(g), 10, replace = TRUE), color = "red")
g$layout <- layout_in_circle

plot(g)

 

That's it. In the column list of the node you should have your incoming data, which you can play with to create your graphs. Hope this helps a little.

Best regards

Jerry

 

Thanks Jerry,

i'll try as soon as possible and give you a response.

Best regards

Alessio

It's write me that it doesn't know the command make_empty_graph

Did you call

Library(igraph)

There was a typo in my code example.

BR Jerry

Yes i call it but the problem doesn't change.

If you want i can post the result and the code that i used in the R snippet internal to R view.

BR Alessio

Hi Alessio,

If that code doens't work you should look at your Knime Version and your RHOME directory in the Knime preferences under Knime->R. Is it the latest Version of Knime and is igraph installed in the /library-Folder of your R-Installation where Knime points to? If that is also correct then a posting of your workflow might help.

BR Jerry

@palmieri3 i think there is no harm sharing the workflow with the pals, now its the only way it can be diagnosed, post it to be helped!

Tripp Pants Black and Red