如何在ggplot上实现gridSVG工具提示?

如何在ggplot上实现gridSVG工具提示?,r,ggplot2,shiny,R,Ggplot2,Shiny,我正在寻找一种最简单的方法,将简单的工具提示添加到由ggplot绘制的基本折线图中。我的数据集在rCharts方面存在一些问题,因此我正在尝试查看gridSVG是否适合我的需要 我正在shinny中构建我的viz,并且我正在尝试遵循此git上的代码: 你看到了吗?这可能比gridSVG方法简单得多。您看到了吗?这可能比gridSVG方法简单得多。 ##ui.R## reactiveSvg <- function (outputId) { HTML(paste("<div id

我正在寻找一种最简单的方法,将简单的工具提示添加到由
ggplot
绘制的基本折线图中。我的数据集在
rCharts
方面存在一些问题,因此我正在尝试查看
gridSVG
是否适合我的需要

我正在
shinny
中构建我的viz,并且我正在尝试遵循此
git
上的代码:

你看到了吗?这可能比
gridSVG
方法简单得多。您看到了吗?这可能比
gridSVG
方法简单得多。
 ##ui.R##
reactiveSvg <- function (outputId) 
{
  HTML(paste("<div id=\"", outputId, "\" class=\"shiny-network-output\"><svg /></div>", sep=""))
}    

mainPanel(
              htmlOutput(outputId = "svg.grid")
               )

##server.R##
output$svg.grid <- reactiveText(function() {
    ggplot(data = sampleData, aes(x=year, y=quantity, group=sample_data))+
      geom_line()+
      ggtitle("Basic gridSVG Example")
    NOT SURE HOW TO USE GRID.SVG TO CREATE A BASIC TOOLTIP ON MY CHART
  })
print(get(exampleInput()))
    #print((paste(input$example,"example",sep=".")))
    tempsvg <- tempfile(fileext=".svg")
    on.exit(unlink(tempsvg))
    gridToSVG(name=tempsvg)
    svgoutput <- readLines(tempsvg, n=-1)
    paste(svgoutput,sep="")