The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Saving Plots in R"
I have been writing code in R but now whish to plot in R using the R extention node. say using ggplot2
I wanted to do this by plotting the output to a file. I tried setting the current directory using the R command setwd and the extention node does not allow this. I then tried to send the output to a file with no address ( png file ) , and would search for the file to see where it landed ..it does not seem to plot it out to a file. I then just plotted it , and it did nothing.
My aim is to send the R graph done under ggplot to a file in the Extention node and then read the file to a report. is this possible ?
Does R plotting or Graphing work in the R extention node ..if so how ?
Thanks
Graham
I wanted to do this by plotting the output to a file. I tried setting the current directory using the R command setwd and the extention node does not allow this. I then tried to send the output to a file with no address ( png file ) , and would search for the file to see where it landed ..it does not seem to plot it out to a file. I then just plotted it , and it did nothing.
My aim is to send the R graph done under ggplot to a file in the Extention node and then read the file to a report. is this possible ?
Does R plotting or Graphing work in the R extention node ..if so how ?
Thanks
Graham
Tagged:
0
Answers
It is possible to write plots to files. Here's an example (for Windows) regards
Andrew
I posted this on the Problems and Support board: " I'm looking to capture the output from the R script somewhere in RapidMiner. If anyone uses R perhaps they could let me know how. Thanks" The Log view does not show, for example, the R regression output or summary results. Is there a way forward with this? Apologies for asking the same question on this board.
As an aside: 1) is it possible to obtain the Log output without dates and times and 2) increase the size of the font? Thanks.
I managed to solve the printout to a file by reading your code and inserting the r part into a r execution code block.
The html code you sent me did not execute..it brought up a normal execution block and not the R execute script block , sending me back a message that the R extention is not loaded ..( It definitely is loaded and working . !) ..wonder what the problem is..
What I would ideally like to do is to send the graph file (.png) ( or object ) to the report generator which is now working for tables.
There may be one of two ways which I cant get to work
1) In the R code block , how would I send the graph file ( .png) to a Report Generator or Report block as an object ? Can I do it via the return ( list (...) ) statement at the end of the r function in the R execute and what do I put in the list ie the file name or a variable name of the graph) If this can be done how do I read it into the Repport block..what are the configiuration parametres ( ie it cant be Data Table , I tried document or file (Error , the document has no pages ) .
2) Reading the file from the directory ..How do i read this in ( Using Open File or what ?) , and then when it goes into the Report block , what are the right parametre settings , as asked above ?
Thanks, this would really help.
Graham
I also have R extension/R script issues. Fortunately, I don't need to solve them just yet.
As far as I know, there is no published interface to pass things to the various Report operators. To read files you can use `Read File`; from there my thought is to create an example set containing an HTML href link to the file and then using that in a table to point to the location.
I haven't tried this
regards
Andrew
If you just use [tt]write.csv((data frame name, file="file_name.csv')[/tt] R will store the file in the current working directory, which is a tmp folder.
To store and retrieve your files, you have to declare a location in the file argument of the write function in R like [tt]write.csv((data frame name, file="C:\User\file_name.csv')[/tt]
Regards,
David
Best,
farmer