title: Creating hover info box and reactive dropdown menu in Shiny
body: <p>This is my first Shiny app, and I just got the basics working to where it allows the user to select from a dropdown menu of clients, then a dropdown menu of test codes to receive a plot of the results for the selected test.</p>
  
  <p>I'd like the second dropdown menu to be updated with the available test codes for that client (all are not present for each client). Also, I would like to be able to hover over the point in the plot and receive more information from the row in the original dataframe.</p>
  
  <p>I've looked into tooltips and the nearPoints() function, but I'm not sure if these can be used on this data since it is manipulated. I'm not sure if at this point it would be easier to import the data in a different way (it will ultimately need to accept either excel files or .csv). Thanks for any help that you would be able to provide, please let me know if there is any other supporting info I can give.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>library(shiny)
  library(scales)
  library(ggplot2)
  
  labData &lt;- 
  read.table("MockNLData.csv", 
  header=TRUE, sep=",")
  
  #convert '&lt;10' and '&lt;20' results
  labData$ModResult &lt;- labData$Result
  levels(labData$ModResult)[levels(labData$ModResult)=="&lt;10"] 
  &lt;- "0"
  levels(labData$ModResult)[levels(labData$ModResult)=="&lt;20"] 
  &lt;- "0"
  #convert results to scientific notation
  SciNotResult &lt;- 
  formatC(as.numeric(as.character(labData$ModResult)), 
  format="e", digits=2)
  
  ui &lt;- fluidPage(
    headerPanel("Dilution History"), 
    sidebarLayout(
      sidebarPanel(
        selectInput(inputId="client", label="Select Client 
  Name", choices=levels(labData$Client.Name)
        ),
        selectInput(inputId="test", label="Select Test Code", 
  choices=levels(labData$Analysis))
        ),
      mainPanel(
        plotOutput("line", hover="plot_hov"),
    verbatimTextOutput("info"))
      )
     )
  
  server &lt;- function(input, output) {
  #selected client into data frame
  selDF &lt;- reactive({labData[labData[,1]==input$client,]
     })
  
  #selected test code into data frame
  subsetDF &lt;- reactive({selDF()[selDF()[,5]==input$test,]
    })
  
  #points to be plotted
  points &lt;- 
  reactive({as.numeric(levels(subsetDF()$ModResult)) 
  [subsetDF()$ModResult]
    })
  
  #plot
    output$line &lt;- renderPlot({
      qplot(seq_along(points()), points(), xlab ="Index", 
  ylab ="Result")
    })
  
  #hover information  
     output$info &lt;- renderText({
     paste0("x=", input$plot_hov$x, "\ny=", 
  input$plot_hov$y)
    })
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Here is what the data looks like:
  <a href="https://i.stack.imgur.com/dO7EW.png" rel="nofollow noreferrer">MockNLData.csv</a></p>
  
  <p>EDIT: I figured out updating the menu with updateSelectInput()</p>