🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Exporting A Graph From The Execute R Script Operator

User: "TobiasNehrig"
New Altair Community Member
Updated by Jocelyn

Hi Experts,

 

I would like to create a graph with a R-script and export it. The script and the export are working in R-Studio.

But I don't get anything in Rapidminer, is there a way to create a graph with the Execute R Script Operator, display the graph and export it?

 

<?xml version="1.0" encoding="UTF-8"?><process version="8.2.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="8.2.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="r_scripting:execute_r" compatibility="8.1.000" expanded="true" height="82" name="Execute R" width="90" x="313" y="34">
<parameter key="script" value="rm_main = function(data)&#10;{&#10;library(igraph)&#10;#setwd ('./home/knecht')&#10;&#10;g &lt;- graph.empty(5, directed = FALSE)&#10;new_edges &lt;- c(1,3, 1,5, 2,5, 4,5)&#10;g&lt;- add.edges(g, new_edges)&#10;pdf(&quot;graph1010.pdf&quot;)&#10;plot(g)&#10;g &lt;-add.vertices(g,1)&#10;g &lt;-add.edges(g, c(6,5))&#10;V(g)$name &lt;- letters[1:vcount(g)]&#10;E(g)$weight &lt;- runif(ecount(g))&#10;get.adjacency(g, attr = &quot;weight&quot;)&#10;print(g)&#10;&#10;return (g)&#10;}&#10;"/>
</operator>
<connect from_op="Execute R" from_port="output 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>

Best regards

Tobias

Find more posts tagged with