# This is a sample for extending pdf device pdf("sample2.pdf") par(oma=c(2,2,2,2)) plot(1:10) #################################################### ## You can make URL link box by "pdf.link.on.box" ## #################################################### pdf.link.on.box(1, 5, 3, 8, url="http://www.r-project.org") ########################################################### ## You can also make popup text box by "pdf.text.on.box" ## ########################################################### for(i in 1:10) pdf.text.on.box(i-0.1, i-0.1, i+0.1, i+0.1, LETTERS[i], border=c(0,0,0)) text(5, 9, "mouse over points!", col=2) ############################################################################ ## URL link and popup text for strings are assigned by "pdf.link.on.text" ## ## and "pdf.text.on.text". Assigned link or popup is drawn strings just ## ## before the function. ## ############################################################################ text(5, 2, "text test") pdf.link.on.text("http://www.google.com") mtext("mtext test 1", cex=2) pdf.text.on.text("Hello, world!") mtext("mtext test 2", side = 2, line=2) pdf.link.on.text("http://www.apple.com") mtext("mtext test 3", outer=T, side = 1) pdf.link.on.text("http://www.bioconductor.org") mtext("mtext test 4", outer=T, side = 4, cex=3) pdf.link.on.text("http://www.playstation.com") dev.off()