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 and stackByTable #101

Closed todolist-larrieu closed 4 years ago

todolist-larrieu commented 4 years ago

Function loadByProduct and stackByTable

Describe the bug

Requesting data using either stackByTable or loadByProduct resorts in this error

"Error in file(file, "rt") : invalid 'description' argument"

To Reproduce <- loadByProduct(dpID = 'DP1.10092.001', site = 'KONZ', startdate = '2015-01-01', enddate = '2019-12-31', check.size=FALSE)

stackByTable("NEON_pathogens-tick.zip")

Expected behavior A clear and concise description of what you expected to happen.

System (please complete the following information):

Additional context

traceback() 7: file(file, "rt") 6: read.table(file = file, header = header, sep = sep, quote = quote, dec = dec, fill = fill, comment.char = comment.char, ...) 5: utils::read.csv(varFile, header = T, stringsAsFactors = F) 4: getVariables(varpath) 3: stackDataFilesParallel(savepath, nCores, dpID) 2: stackByTable(filepath = paste(temppath, "/filesToStack", substr(dpID, 5, 9), sep = ""), savepath = "envt", folder = TRUE, nCores = nCores, saveUnzippedFiles = FALSE) 1: loadByProduct(dpID = "DP1.10092.001", site = "KONZ", startdate = "2015-01-01", enddate = "2019-12-31", check.size = FALSE)

cklunch commented 4 years ago

@todolist-larrieu Thanks for the alert! This is now fixed on GitHub, I'll close this issue once the next version goes to CRAN. In the meantime, you can either install the development version of neonUtilities from here, or modify your download to include a little more data - this turned out to be a fairly unlikely bug to hit, and in this case it wouldn't happen if another site was added to the download: tckpath <- loadByProduct(dpID = 'DP1.10092.001', site = c('KONZ', 'KONA'), check.size=FALSE)

cklunch commented 4 years ago

@todolist-larrieu This is fixed in v1.3.7, now on CRAN.