Skip to content

Commit

Permalink
fixed remaining cache directory calls for fxn call instead of var name
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Oct 22, 2016
1 parent 693cb76 commit 7448dc9
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/argo.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ argo <- function(dac, id, cycle, dtype, overwrite = TRUE, ...) {
call. = FALSE)
}

path <- file.path(rnoaa_cache_dir, "argo")
path <- file.path(rnoaa_cache_dir(), "argo")
path <- file.path(path, dac)
apath <- a_local(dac, id, cycle, dtype, path)
if (!is_isd(apath)) {
Expand Down
2 changes: 1 addition & 1 deletion R/caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ghcnd_clear_cache <- function(force = FALSE) {
call. = FALSE)
}

path <- file.path(rnoaa_cache_dir, "ghcnd")
path <- file.path(rnoaa_cache_dir(), "ghcnd")
files <- list.files(path, full.names = TRUE)
unlink(files, recursive = TRUE, force = force)
}
5 changes: 3 additions & 2 deletions R/ersst.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#' @section File storage:
#' We use \pkg{rappdirs} to store files, see
#' \code{\link[rappdirs]{user_cache_dir}} for how we determine the directory on
#' your machine to save files to, and run \code{user_cache_dir("rnoaa")}
#' your machine to save files to, and run
#' \code{rappdirs::user_cache_dir("rnoaa/ersst")}
#' to get that directory.
#'
#' Files are quite small, so we don't worry about reading in cached data to
Expand Down Expand Up @@ -53,7 +54,7 @@ ersst <- function(year, month, overwrite = TRUE, ...) {
call. = FALSE)
}
check4pkg("ncdf4")
path <- file.path(rnoaa_cache_dir, "ersst")
path <- file.path(rnoaa_cache_dir(), "ersst")
ff <- ersst_local(path, year, month)
dpath <- ersst_GET(make_ersst(year, month), path = ff, overwrite, ...)
ncdf4::nc_open(dpath)
Expand Down
7 changes: 4 additions & 3 deletions R/tornadoes.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#' @references \url{http://www.spc.noaa.gov/gis/svrgis/}
#'
#' @section File storage:
#' We use \pkg{rappdirs} to store files, see \code{\link[rappdirs]{user_cache_dir}} for how
#' We use \pkg{rappdirs} to store files, see
#' \code{\link[rappdirs]{user_cache_dir}} for how
#' we determine the directory on your machine to save files to, and run
#' \code{user_cache_dir("rnoaa")} to get that directory.
#' \code{rappdirs::user_cache_dir("rnoaa/tornadoes")} to get that directory.
#'
#' @examples \dontrun{
#' shp <- tornadoes()
Expand All @@ -26,7 +27,7 @@ tornadoes <- function(overwrite = TRUE, ...) {
}

check4pkg('rgdal')
path <- file.path(rnoaa_cache_dir, "tornadoes")
path <- file.path(rnoaa_cache_dir(), "tornadoes")
if (!is_tornadoes(path)) {
url <- 'http://spc.noaa.gov/gis/svrgis/zipped/tornado.zip'
tornadoes_GET(path, url, overwrite, ...)
Expand Down
4 changes: 2 additions & 2 deletions man-roxygen/argo_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
#' @section File storage:
#' We use \pkg{rappdirs} to store files, see
#' \code{\link[rappdirs]{user_cache_dir}} for how we determine the directory on
#' your machine to save files to, and run \code{user_cache_dir("rnoaa")}
#' to get that directory.
#' your machine to save files to, and run
#' \code{rappdirs::user_cache_dir("rnoaa/argo")} to get that directory.
#'
#' The \code{path} parameter used to be used to set where files are stored
#' on your machine.
Expand Down
4 changes: 2 additions & 2 deletions man/argo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/ersst.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/tornadoes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7448dc9

Please sign in to comment.