title: Drop down menu in Plotly
body: <p>I'm trying to add a drop down menu in <a href="https://plot.ly/~rohitsinghrajput97/7/" rel="nofollow noreferrer">this</a> plotly plot. The code is :</p>
  
  <pre><code>library(plotly)
  library(readxl)
  Sys.setenv("plotly_username"="xxx")
  Sys.setenv("plotly_api_key"="xxx")
  df &lt;- read_excel("From\\a\\certain\\location.xlsx")
  k = (df$keyword=="alpha")
  j = (df$keyword=="beta")
  
  # give state boundaries a white border
  l &lt;- list(color = toRGB("grey"), width = 0.5)
  # specify some map projection/options
  g &lt;- list(
    showframe = FALSE,
    showcoastlines = FALSE,
    projection = list(type='Mercator')
  )
  
  df2 = df
  p &lt;- plot_geo(df2, locationmode = 'country names') %&gt;%
    add_trace(
      z = ~hits, locations = ~location,
      color = ~hits, colors = 'Blues',marker=list(line=l)
    ) %&gt;%
    colorbar(title = "Hits") %&gt;%
    layout(
      title = 'For Addiction',
      geo = g
    )
  p &lt;-p %&gt;% layout(
    updatemenus = list(
      list(
        buttons = list(
          list(method = "restyle",
               args = list("df2",list(df[k,])),
               label = "alpha"),
          list(method = "restyle",
               args = list("df2",list(df[j,])),
               label = "beta")))
    ))
  
  # Create a shareable link to your chart
  # Set up API credentials: https://plot.ly/r/getting-started
  
  chart_link = plotly_POST(p, filename="Example.html",sharing = c("public"))
  chart_link
  </code></pre>
  
  <p>The plot, does contain the drop down menu, but it doesn't work. Changing the values of the drop down doesn't change the plot itself.  </p>
  
  <p>There is a <a href="https://stackoverflow.com/questions/40024029/plotly-updating-data-with-dropdown-selection">similar question</a>, but following it's (only) answer, I didn't get the drop down to work.(by putting the <code>df[k,]</code> and <code>df[j,]</code> in lists. So how to make those drop downs work? Any help appreciated.</p>
  
  <hr>
  
  <p>The example dataset is<br>
   <a href="https://i.stack.imgur.com/eLtT5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eLtT5.png" alt="enter image description here"></a><br>
   And it can be found <a href="https://drive.google.com/open?id=0B9mhKvFn5lkOcWV4NmZKcFJCTlk" rel="nofollow noreferrer">here</a>.</p>