[R-gui] Plots not generating or running in web-browser

Neha Sinha nehasinha30 at gmail.com
Thu Jun 9 17:54:11 CEST 2005


Hi,

I am a beginner in R (using it for about 2-3 days now) and I have a couple 
of problems I am encountering.

I am working on a windows machine and using putty to ssh into the "box" 
where R is installed (I think Unix is running on the box I ssh into). The 
problem I am facing is that when I try to plot using the plot function in R 
(after invoking x11), nothing shows up - no window pops up with the plot. 
But when I use the startx command in cygwin and ssh, the graph pops up.

My project is to graph a couple of points and display it on the web, so that 
other users in my group can view it. The code I am using just to generate a 
graph of random numbers is as follows:

#! /bin/sh /usr/bin/setR

cat("Content-type: text/html", '\n\n')

library(grDevices)
library(graphics)

cat("<html><head><title> 1st test page </title></head>",'\n')
cat("<body>",'\n')

r <- sample(1:20, 5)
cat("Random plot: ", r,'<br/>\n')

x11("192.9.200.232:0 <http://192.9.200.232:0>.0")
png(file="/tmp/R-web/random.png")
plot( r, type="b" )
dev.off()
cat("<img src='http://splustest/plots/random.png'/>",'\n')

cat("</body>",'\n')
q(save="no")

Now when I open a webbrowser on my machine and load this html/.R code, the 
graph is not generated (as I checked in the random.png file) nor does it 
show up. Clearly, this is happening because some x11 settings on my machine 
is missing. I am stuck at a point where I do not know how to fix this 
problem. I would be thankful for some helpful advice.

Regards,

Neha Sinha

	[[alternative HTML version deleted]]



More information about the R-SIG-GUI mailing list