NEONScience/NEON-utilities

Select release in zipsByProduct()

annakat opened this issue · 4 comments

With the recent NEON data release I was wondering if it would make sense to add the selection of a particular release to zipsByProduct(). Currently zipsByProduct () downloads released and provisional data. stackByTable() could also use this option. Thanks!

Re-upping this. I see a place where this could occur around line 207 of zipsByProduct(). I guess the use case is to be able to filter by known release, such that an analysis could be reproducible even with continued provisional data release. I could see one approach being to add a flag in the zipsByProduct() function to specify the release. By example, I arbitrarily set the release to "RELEASE-2021" and exclude all the data urls which don't conform to this. Is this a viable option? Open to thoughts and other approaches.

release <- 'RELEASE-2021'
inds <- which(sapply(avail$data$siteCodes$availableReleases, function(x){x[1]==release}))

Then subset the availableDataUrls before the grab to be only that release if the flag is satisfied.

month.urls <- unlist(avail$data$siteCodes$availableDataUrls[inds])

@annakat @taddallas This is enabled in zipsByProduct() and loadByProduct() on Github, expecting to submit to CRAN next week. Feel free to try it out here!

Ah nice. Looks like the solution you went with is pretty similar, but at the getZipUrls level (and then referenced in the zipsByProduct etc.. Looks great! Feel free to close issue.

@annakat @taddallas neonUtilities 2.1.0 is now on CRAN, including download by release.