I got the answer for above. Here is what I did.
ui.RuiOutput("city_dropdown")
And my server.R
looks like following
output$city_dropdown <- renderUI({ city <- reg_city(final_data) city <- city$registrant_city city <- as.list(city) selectInput("email_select", "Select Email Content", choices = city )})
reg_city()
gives me the top 10 cities which I want to populate into drop down box,then converting it to a list gives me desired output.