[R] Can a hyperlink be placed, thorugh R programming, on a graph?

Aldi Kraja aldi at wustl.edu
Thu Apr 26 21:19:54 CEST 2007


Ok,

Here is a simple solution:
One can apply the text step (within a loop) for any other points and the 
hyperlinks are functional in the pdf format, and not viewable unless the 
mouse is over the link.
If you have a better solution, let me know.


x<-1:10
 y<-rnorm(10,0,1)
pdf(file="c:\\aldi\\test.pdf")
plot(x,y)
segments(x,y,x+2,y+2)
text(x[3],y[3],c("http://www.r-project.org"),cex=0.1,col="white")
segments(x,y,x+0.5,y+0.5,col=3)

dev.off()

Thanks,

Aldi


Aldi Kraja wrote:

>Hi,
>If I use 
>
>x<-1:10
> y<-rnorm(10,0,1)
>### pdf(file="c:\\aldi\\test.pdf")
> plot(x,y)
> segments(x,y,x+2,y+2)
> segments(x,y,x+0.5,y+0.5,col=3)
>### dev.off()
>### q()
>
>Is there a way that I can imbed in the graph plot for each point defined 
>by x to x+0.5 and y to y+0.5 (and colored in green) a different hyperlink?
>
>For example point one (together with the green tail) will have the 
>hyperlink: www.r-project.org; point 2 with the link www.google.com; 
>point 3 with the link www.yahoo.com etc.
>
>So in general, can the graph be manupulated within R?
>
>TIA,
>
>Aldi
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
>  
>



More information about the R-help mailing list