NEONScience / NEON-utilities

Utilities and scripts for working with NEON data. Currently: an R package with functions to join (stack) the month-by-site files in downloaded NEON data, to convert data to geoCSV format, and to download data from the API.
GNU Affero General Public License v3.0
57 stars 36 forks source link

loadByProduct() fails while stacking for DP1.20093.001 #89

Closed jcoloso closed 4 years ago

jcoloso commented 4 years ago

Function loadByProduct, stackByTable

Describe the bug It downloads the data but crashes while stacking table swc_externalLabDataByAnalyte with the error: "Error in if (tbltype == "site-all") { : argument is of length zero"

To Reproduce loadByProduct(dpID=dpid,site=c('POSE','LEWI'),startdate='2017-01',enddate='2019-01',check.size=FALSE)

Expected behavior function should download requested DP resulting in a list containing the data.

System (please complete the following information):

Additional context The error occurs on neonUtilities version 1.3.3, but not on 1.3.1. Other DPs work. For example, DP1.20163.001 worked just fine with version 1.3.3.

cklunch commented 4 years ago

@jcoloso This happens occasionally when a data product is modified, so the metadata about the product are out of sync with the database. Usually it involves a new table getting added to a product, but other changes can cause it as well. Water chemistry is getting a new table, so it's temporarily mismatched.

This is fixed in version 1.3.4, which is currently only available on GitHub. We're planning a new CRAN release in the next few weeks, but in the meantime, you can install from here: devtools::install_github('NEONScience/NEON-utilities/neonUtilities')

cklunch commented 4 years ago

@jcoloso v1.3.4 is now live on CRAN, DP1.20093.001 will stack correctly.