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

stackByTable reading wrong dpID #60

Closed NateMietk closed 4 years ago

NateMietk commented 4 years ago

Function stackByTable

Describe the bug Following the tutorial https://www.neonscience.org/get-started-neon-series > Stack the downloaded data files: stackByTable() and using the 3 most recent records from the NIWO site in the PAR dataset (DP1.00024.001) I am generating the error:

stackByTable("data/NEON_par.zip")

Error in stackByTable("data/NEON_par.zip") : 
  D10.RMNP.DP1. is not a properly formatted data product ID. The correct format is 
DP#.#####.001, where the first placeholder must be between 1 and 4.

In this example the code is selecting the wrong string as the dpID value.

If I then hard code the dpID, I receive the same error message:

stackByTable("data/NEON_par.zip", dpID = 'DP1.00024.001') 

Error in stackByTable("data/NEON_par.zip") : 
  D10.RMNP.DP1. is not a properly formatted data product ID. The correct format is 
DP#.#####.001, where the first placeholder must be between 1 and 4.

If I then manually unzip the folder, keeping all things stated above the same, the function works.

stackByTable("data/NEON_par", folder=TRUE, dpID = 'DP1.00024.001') # finally works

Expected behavior I expected any of these three calls would have unzipped and stacked the specified data. Only the last example worked, when I manually unzipped the file folder.

System (please complete the following information):

cklunch commented 4 years ago

dpID is no longer a required input for stackByTable, it is included only for back compatibility. Including it in the function call makes no difference.

I have never been able to replicate this error.

However, this is apparently fixed in the new release, without any detected side effects.