I've been experimenting some with the graphlets which S-Plus 6.1 has. Is there something similar in R? I've looked through documentations, and at SJava, but haven't found it. (If you don't know what a graphlet is, here's what it appears to be: a graphlet is a binary file that encodes information about a graph. Java uses spgraph.jar to display the graph and allow certain actions - clicking on individual points can bring up a text string or a href, there can be active regions, etc. Basically, it seems like a simple way for us non-Java folks to get a graph with links up, using S-Plus.) Any leads would be appreciated. Thanks, John ............................................................................ ..... John Nolan Visiting Fellow, National Institutes of Health NIH/CIT, Building 12A, Room 2001 phone: 301.402.9712 fax: 301.402.4544 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "john" == John Nolan <Nolan> writes:john> I've been experimenting some with the graphlets which S-Plus john> 6.1 has. Is there something similar in R? I've looked john> through documentations, and at SJava, but haven't found it. john> (If you don't know what a graphlet is, here's what it john> appears to be: a graphlet is a binary file that encodes john> information about a graph. Java uses spgraph.jar to display john> the graph and allow certain actions - clicking on individual john> points can bring up a text string or a href, there can be john> active regions, etc. Basically, it seems like a simple way john> for us non-Java folks to get a graph with links up, using john> S-Plus.) An extremely crude version is the ROrca package, which provides linked plots, dynamic graphics, brushing, and extraction of brushed points. See http://software.biostat.washington.edu/statsoft/orca for links to a preliminary version. You need SJava to make it work. I'm not going to be doing much with it in the next 2 months, but have a large set of additions for 2003 (assuming a number of things which may/may not happen). best, -tony -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini at u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org -------------- http://software.biostat.washington.edu/ ---------------- FHCRC: M: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX (my tuesday/wednesday/friday locations are completely unpredictable.) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This sample code creates a image map html file (similar to SPlus graphlets?)
that references a PNG file. Its not pretty but should give you some ideas to
make some simple R plots more web-interactive. You might need to change the
paths, etc to get it to work on your environment. Should be easy to wrap
this up in a more generic function.
Landon Jensen
Fab3 Parametrics/Integration
Micron Technology, Inc.
################
# data
x<-1:10
y<-rnorm(10)
#range of data
xmin<-min(x)
xmax<-max(x)
ymin<-min(y)
ymax<-max(y)
xdelta<-xmax-xmin
ydelta<-ymax-ymin
# pixel size of png plot
xsize<-600
ysize<-400
# define click zones (+/- pixels)
clickzones=5
# create png plot
png(file="/home/www/html/temp/imagemap.png",height=ysize,width=xsize)
par(mar=c(4,4,4,4))
plot(x,y)
usr<-par("usr")
plt<-par("plt")
dev.off()
# create mapping, active area coordinates
x1pixels<-clickzones
x2pixels<-clickzones
y1pixels<-clickzones
y2pixels<-clickzones
dataxmin<-usr[1]
dataxmax<-usr[2]
dataymin<-usr[3]
dataymax<-usr[4]
plotxmin<-plt[1]
plotxmax<-plt[2]
plotymin<-plt[3]
plotymax<-plt[4]
datawidth<-dataxmax-dataxmin
dataheight<-dataymax-dataymin
ratioxmin<-dataxmin/plotxmin
ratioxmax<-dataxmax/plotxmax
ratioymin<-dataymin/plotymin
ratioymax<-dataymax/plotymax
pixelxmin<-dataxmin*xsize/ratioxmin
pixelxmax<-dataxmax*xsize/ratioxmax
pixelymin<-dataymin*ysize/ratioymin
pixelymax<-dataymax*ysize/ratioymax
pixelwidth<-pixelxmax-pixelxmin
pixelheight<-pixelymax-pixelymin
AAC<-c()
for(i in 1:length(x)) {
x1<-(x[i]-dataxmin)/datawidth
x1<-x1*pixelwidth
x1<-floor(x1+pixelxmin + .5)
y1<-(1-(y[i]-dataymin)/dataheight)
y1<-y1*pixelheight
y1<-floor(y1+pixelymin + .5)
AAC<-c(AAC,paste((x1-x1pixels),",",(y1-y1pixels),",",(x1+x2pixels),",",(y1+y
2pixels),sep=""))
}
# create html file
write("<html><head><title>Image Map
Test</title></head><body>",file="/home/www/html/temp/imagemap.html")
write("<img src='imagemap.png' border=1
usemap='#imagemap.png'
ISMAP>",file="/home/www/html/temp/imagemap.html",append=TRUE)
write("<map
name='imagemap.png'>",file="/home/www/html/temp/imagemap.html",append=TRUE)
for(i in 1:length(x)) {
write(paste("<area coords='",AAC[i],"'
alt='x=",x[i],",y=",y[i],"'
href='http://yelinux3.micron.com/temp/test.html'>",sep=""),file="/home/www/h
tml/temp/imagemap.html",append=TRUE)
}
write("</map></body>",file="/home/www/html/temp/imagemap.html",append=TRUE)
write("</html>",file="/home/www/html/temp/imagemap.html",append=TRUE)
################
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._