Closed taddallas closed 8 years ago
Easy fix, though it could be prettier, I bet (pasted below).
@sckott: I'd like to help out with this effort if I can. I have a cloned copy of the repo, but don't have permissions to push any of my changes. I have a branch named tad
currently on my local machine.
fia_fetch <- function(state, what = "tree", overwrite = FALSE, ...) {
stopifnot(inherits(what, "character"))
stopifnot(length(what) >= 1)
if(state=='all'){
urls <- file.path(fia_base(), "CSV", paste0(what, ".zip"))
}else{
urls <- unlist(lapply(state, function(x) {
file.path(fia_base(), "CSV", paste0(x, "_", what, ".zip"))
}))
}
nms <- gsub("\\.zip", "", basename(urls))
setNames(lapply(urls, function(z) {
xx <- fia_cache_GET(z, overwrite, ...)
suppressMessages(readr::read_csv(un_zip(xx)))
}), nms)
}
Right, I didn't yet implement the all option for that parameter.
Thanks for helping. Can you fork to your account, create that new branch, add your changes, then push back up to your account, then send pull request here
fix via #6
Playing around with the package, and
fia_fetch
returnsfrom
fia_fetch("all", "subplot_regen")
taken fromfia_fetch
documentation.