This is a standalone function used to replace the internal SWMPrExtension sampling sites data table used by the get_sites.R function. It reads a csv-formatted file of all NERRS SWMP stations that the user has downloaded from the CDMO SWMP station website: https://cdmo.baruch.sc.edu/data/swmp-stations/.
This downloaded csv-formatted file and its location are the only input arguments to update_sampling_station()
. The current station information is loaded from data/sampling_stations.rda
, a copy of which is written out as data/sampling_stations_backup.rda
, and the new data file is read, formatted appropriately, and written out as data/sampling_stations.rda
.
Note: This function need only be run when new reserves are added, stations are moved, etc.