`execute R` how to return something that is not a table

juju
juju New Altair Community Member
edited November 5 in Community Q&A

Hi, it seems `execute R` only expect a data table as the return value.

When I return a simple real number, and it's recognized as `memory buffered file`.

(Tried to return a model, and same thing happened.)

 

Any help's appreciated. Thanks-

 

Code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.4.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.4.000" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="r_scripting:execute_r" compatibility="6.4.000" expanded="true" height="76" name="test" width="90" x="313" y="30">
<parameter key="script" value="rm_main = function(){&#10; &#10; cat('Starting R script now ...\n')&#10;&#10; x = 0.1&#10; x&#10;&#10;}"/>
</operator>
<connect from_op="test" from_port="output 1" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="90"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>

 

Tagged:

Answers

  • bhupendra_patil
    bhupendra_patil New Altair Community Member

    hello @juju

     

    You are right, only datatables can be understood by standard rapidminer operators.

    So anything else that needs to be passed to RM operator needs to be a datatable

     

    However your R objects can be passed to other R scripts as needed.

     

    The execute R operator has an example tutorial process, "Training and applying a linear model in R"  which shows how this concept works

     

    Hope it is helpful