I'm trying to embed hyperlinks within a plot of likert data, using a combination of the likert package and the gridSVG packages. I want to link the text of each question to a separate link, but I'm having problems. The following code embeds a single link to the text of every question, but I can't figure-out how to embed on each question separately, because the set of questions seem to be grouped in a single grob together. Thanks in advance for your input.
#creates an example plot from sample data from likert package.
require(likert)
data(pisaitems)
items29 <- pisaitems[,substr(names(pisaitems), 1,5) == "ST25Q" ]
names(items29) <- c("Magazines", "Comic books", "Fiction",
"Non-fiction books", "Newspapers")
l29 <- likert(items29)
summary(l29)
plot(l29)
require(grid)
require(gridSVG)
#identifies grob of question text (all questions are in a single grob)
titleGrobName <- grep("axis-l.3-3-3-3", grid.ls(print=FALSE)$name, value=TRUE)
#embeds link in grob
grid.hyperlink(titleGrobName, "http://www.r-project.org")
#creates svg
gridToSVG("testPlot.svg", "none", "none")