TADA_FindNearbySites should choose representative sites for site groups
Is your feature request related to a problem? Please describe.
Currently, the function identifies sites within some buffer distance of each other, but it only assigns them to a site group and does not automatically harmonize them to one site's metadata. This is difficult when subsequent functions (like total NP summation) depend upon monitoring location identifier as a grouping variable to define total N or total P summations - which site to assign these totals to if they should come from multiple nearby sites (probably a rare situation)?
Describe the solution you'd like
The function could have an organization hierarchy like the duplicate functions and could preferentially pick the best-ranked organization to provide the key metadata needed to merge sites to one (I'm thinking monitoring location ID, name, latitude, longitude and...??).
library(TADA)
super_cool_feature(x, y)
Describe alternatives you've considered
If user relies on Module 2 before Module 1, this could alleviate some of the challenge of knowing where is best to join sites. Since monitoring locations contain information completely independent of QC, it might make more sense to handle sites before the QC steps. However, the apps are being developed to be independent of one another, so this may not be feasible.
Additional context
This solution needs to be considered in the context of module 2 of the shiny app as well. One of its potential uses is to group sites.
Reminders for TADA contributors addressing this issue
New features should include all of the following work:
-
[ ] Create the function/code.
-
[ ] Document all code using comments to describe what is does.
-
[ ] Create tests in tests folder.
-
[ ] Create help file using roxygen2 above code.
-
[ ] Create working examples in help file (via roxygen2).
-
[ ] Add to appropriate vignette (or create new one).
This function may not be the best place to make decisions on which site to pick without the ability to see sites on a map. But we could give this function this option if desired.
I agree it would be nice to see them on the map. If the option was added to the function, then we could potentially add this to the overview tab in Shiny since the map is there. That tab also already has a list of all organizations and the result counts for each - which may be helpful for the user in this context. We could color the nearby sites in a different color (red?) or shape on the map (possibly auto-randomly select one organization when you get to the page, but then let a user choose which org to keep).
Closing this issue and addressing it elsewhere: https://github.com/USEPA/TADA/issues/475