• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

"R" graph output

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Robert;

Just read the intro to your book, very interesting stuff. This is the first time I've read about the "R" language, but it sounds like something I should be looking at since part of my job is to find interesting ways to visualize data.

Now the graphs you create in "R", how are they output, are they displayed on a top level window when you run "R" programs or is there more control for the output, say save it is a PNG, or output to a stream? I'm just wondering how you capture the graphical output if you wanted to say show the results in a webpage.

Oh and BTW, is "R" a JVM language? I get the impression it is not, but just wondering ...

Thanks!

Augusto
 
author
Posts: 33
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Augusto,

When you run R interactively, you have the choice of directing a graph to device window (the default) and/or saving it to a pdf, png, jpeg or postscript file. Multiple images can be saved in a single pdf. On windows, you can also save the image as a windows metafile (wmf) or bmp file.

So for example, if I execute the command
plot(mygraph)
at an interactive prompt, a window will pop open with the graph displayed. I can save the file to multiple formats from menu options in that window.

If I execute the command
png("mygraph.png")
at an interactive prompt, the graph is saved to the file mygraph.png.

If you run an R script in batch, then you would want to write the graph to a file.

BTW, there are R packages (e.g., R2HTML) that will help you to embed R graphics in web pages easily.

R is not a JVM language.
reply
    Bookmark Topic Watch Topic
  • New Topic