Function for Identifying Polygon Objects In A Map In Shiny
mingiPolygons.RdThis package is able to select any polgyon object(country, county or state) from any map visualization formed by ggplot or any other package extension deployed in Shiny. It is an extension of nearPoints() but specifically for maps. It takes in original data used to form map in ggplot, data collected by nearPoints function and input$plot_click value
Arguments
- data_main
- original data used to form map in ggplot 
- click_vector
- input$plot_click value 
- col_spec
- column containing names of polygon objects 
- thresh
- the threshold value for data points that can be collected by nearPoints function 
- max_pts
- the number of data points to be collected by nearPoints function 
Examples
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--  or do  help(data=index)  for the standard data sets.
## The function is currently defined as
state <- mingiPolygons(final_stats, sep_df, unknown, "county")
#> Error in nearPoints(data_main, click_vector, threshold = thresh, maxpoints = max_pts,     xvar = "x", yvar = "y"): could not find function "nearPoints"
print(state)
#> Error in eval(expr, envir, enclos): object 'state' not found