USGS-R / wateRuse

Moved to: https://code.usgs.gov/water/water-use/wateruse
https://code.usgs.gov/water/water-use/wateruse
Creative Commons Zero v1.0 Universal
7 stars 11 forks source link

Failure to import Aquifer data exported from AWUDS 3.2.4 #187

Closed grrmartin-USGS closed 6 years ago

grrmartin-USGS commented 7 years ago

Version 1.0.6 fails to import Aquifer data exported from AWUDS 3.2.4 (Shiny screen turns gray). If a TP total population worksheet is added to the file, it will import ok. AWUDS 3.2.4 does not provide option to export TP with Aquifer data. It seemed earlier versions wateRuse did when tested import the pre-AWUDS 3.2.4 Aquifer files without the TP worksheet. Need to revise code to import Aquifer data exported AWUDS 3.2.4 (without the TP worksheet).

rwdudley-usgs commented 7 years ago

Tracked problem to server.R in the observe function beginning line 423. It is failing at the subset_wuse function at line 429 because data.elements is receiving an NA value at line 425. I can't determine why it's getting an NA.

rwdudley-usgs commented 6 years ago

Simplest solution I saw for this issue was to put an empty TP variable in the w.use dataframe in the event that the TP worksheet is missing from the AWUDS export file. Doing so avoids errors selecting TP columns that don't exist which was causing wateRuse to crash.