Where do the results of R-Scripts go? Configuration problem for RapidMiner Studio only?

MPB_
MPB_ New Altair Community Member
edited November 2024 in Community Q&A
Hi there,

I am struggling with exporting results from the Execute R Script Operator.

Here is how the script and the process look like :



After the process is successfully done, I only get The result
Memory buffered file


However, there is no file written.


The RapidMiner log only says


INFO: No filename given for result file, using stdout for logging results!
Mar 04, 2020 10:36:58 AM com.rapidminer.Process execute
INFO: Process //Aggr/R_test starts
Mar 04, 2020 10:36:58 AM com.rapidminer.Process saveResults
INFO: Saving results.
Mar 04, 2020 10:36:58 AM com.rapidminer.Process execute
INFO: Process //Aggr/R_test finished successfully after 0 s




Since the code is running without any errors and with the expected results in R-Studio, I think it must be a configuration issue


What did I do wrong?


Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

  • YYH
    YYH
    Altair Employee
    edited March 2020 Answer ✓
    Hi @MPB_,
    It is easy to get the location of your output file. 
    Just add getwd() in your scripts
    Check your Log view, there should be a temp folder that store your sink file.
    Why?
    Because in your scripts, you used a relative location instead of specifying a physical location in your system. I would suggest using a complete file path like "C:\\Users\\MPB\Documents\\Routput\\outputsink.txt" for the output text file.
    sink("where_is_that_text.txt")

Answers

  • varunm1
    varunm1 New Altair Community Member
    @MPB_

    So, you can view your model summary in "Log" window of rapidminer (VIEW --> Show Panel --> Log). The output of R script when connected to result port will only display example sets and others like models will be displayed as memory buffer files. I think you should use a return function if you are planning to output a data frame.

    @yyhuang can help you more with this.

  • MPB_
    MPB_ New Altair Community Member
    Hi @varunm1 ,

    thank you very much for your reaction.

    In this case, I explicitly want to write a new file. I do not need to see any results in RapidMiner, but a .txt-File written into a directory on my computer would be amazing.
    Unfortunately, a return function is not doing the job,
    @yyhuang gave me the very great advice to use a sink function.
    The sink function works perfectly fine in R(studio) and writes a new file,  but does not in RapidMiner. 




  • YYH
    YYH
    Altair Employee
    edited March 2020 Answer ✓
    Hi @MPB_,
    It is easy to get the location of your output file. 
    Just add getwd() in your scripts
    Check your Log view, there should be a temp folder that store your sink file.
    Why?
    Because in your scripts, you used a relative location instead of specifying a physical location in your system. I would suggest using a complete file path like "C:\\Users\\MPB\Documents\\Routput\\outputsink.txt" for the output text file.
    sink("where_is_that_text.txt")
  • MPB_
    MPB_ New Altair Community Member
    Hi @yyhuang ,

    thank you so much for your help and your patience.
    Simply adding the directory in the sink function did the Job.
    You made my Day! Thank you again :)
  • YYH
    YYH
    Altair Employee
    Glad to know it works for you! Thank you @MPB_ again for sharing the use case and feedback. 

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.