Skip to content

Commit f0e4f55

Browse files
committed
fix: CRAN requests
1. cran comments explaining dontrun 2. citations 3. removing some dontruns and/or examples
1 parent cfa1d77 commit f0e4f55

File tree

11 files changed

+67
-45
lines changed

11 files changed

+67
-45
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Authors@R:
1818
)
1919
URL: https://cmu-delphi.github.io/epidatr/, https://cmu-delphi.github.io/delphi-epidata/, https://github.com/cmu-delphi/epidatr
2020
BugReports: https://github.com/cmu-delphi/epidatr/issues
21-
Description: The Delphi 'Epidata' API provides real-time access to epidemiological surveillance data for influenza, COVID-19, and other diseases for the USA at various geographical resolutions, both from official government sources such as the Center for Disease Control (CDC) and Google Trends and private partners such as Facebook and Change Healthcare. It is built and maintained by the Carnegie Mellon University Delphi research group.
21+
Description: The Delphi 'Epidata' API provides real-time access to epidemiological surveillance data for influenza, COVID-19, and other diseases for the USA at various geographical resolutions, both from official government sources such as the Center for Disease Control (CDC) and Google Trends and private partners such as Facebook and Change Healthcare. It is built and maintained by the Carnegie Mellon University Delphi research group. To cite this API: David C. Farrow, Logan C. Brooks, Aaron Rumack, Ryan J. Tibshirani, Roni Rosenfeld (2015). Delphi Epidata API. <https://github.com/cmu-delphi/delphi-epidata>
2222
Depends: R (>= 3.5.0)
2323
License: MIT + file LICENSE
2424
Encoding: UTF-8

R/cache.R

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ cache_environ$epidatr_cache <- NULL
6868
#' encoding of the call url. Each file corresponds to a unique epidata-API
6969
#' call.
7070
#' @examples
71-
#' \dontrun{
7271
#' set_cache(
73-
#' dir = "some/subdir",
72+
#' dir = tempdir(),
7473
#' days = 14,
7574
#' max_size = 512,
76-
#' logfile = "some/subdir/logs.txt"
75+
#' logfile = "logs.txt"
7776
#' )
78-
#' }
7977
#'
8078
#' @param cache_dir the directory in which the cache is stored. By default, this
8179
#' is `tools::R_user_dir()` if on R 4.0+, but must be specified for earlier
@@ -92,6 +90,8 @@ cache_environ$epidatr_cache <- NULL
9290
#' variable is `EPIDATR_CACHE_LOGFILE`.
9391
#' @param confirm whether to confirm directory creation. default is `TRUE`;
9492
#' should only be set in non-interactive scripts
93+
#' @return [`NULL`] no return value, all effects are stored in the package
94+
#' environment
9595
#' @seealso [`clear_cache`] to delete the old cache while making a new one,
9696
#' [`disable_cache`] to disable without deleting, and [`cache_info`]
9797
#' @export
@@ -176,28 +176,23 @@ set_cache <- function(cache_dir = NULL,
176176
#' are using a session unique cache, you will have to pass the arguments you
177177
#' used for `set_cache` earlier, otherwise the system-wide `.Renviron`-based
178178
#' defaults will be used.
179-
#' @examples
180-
#' \dontrun{
181-
#' clear_cache(
182-
#' dir = "some/subdir",
183-
#' days = 14,
184-
#' max_size = 512,
185-
#' logfile = "some/subdir/logs.txt",
186-
#' )
187-
#' }
188179
#' @param disable instead of setting a new cache, disable caching entirely;
189180
#' defaults to `FALSE`
190181
#' @inheritDotParams set_cache
182+
#' @return [`NULL`] no return value, all effects are stored in the package
183+
#' environment
191184
#' @seealso [`set_cache`] to start a new cache (and general caching info),
192185
#' [`disable_cache`] to only disable without deleting, and [`cache_info`]
193186
#' @export
194187
#' @import cachem
195188
clear_cache <- function(disable = FALSE, ...) {
196-
cache_environ$epidatr_cache$destroy()
197-
if (!disable) {
198-
set_cache(...)
199-
} else {
189+
if (!is.na(cache_environ$epidatr_cache)) {
190+
cache_environ$epidatr_cache$destroy()
191+
}
192+
if (disable) {
200193
cache_environ$epidatr_cache <- NULL
194+
} else {
195+
set_cache(...)
201196
}
202197
}
203198

@@ -207,6 +202,8 @@ clear_cache <- function(disable = FALSE, ...) {
207202
#' the cache are untouched. If you are looking to disable the caching more
208203
#' permanently, set `EPIDATR_USE_CACHE=FALSE` as environmental variable in
209204
#' your `.Renviron`.
205+
#' @return [`NULL`] no return value, all effects are stored in the package
206+
#' environment
210207
#' @export
211208
#' @seealso [`set_cache`] to start a new cache (and general caching info),
212209
#' [`clear_cache`] to delete the cache and set a new one, and [`cache_info`]
@@ -220,6 +217,7 @@ disable_cache <- function() {
220217
#' @description
221218
#' Print out the information about the cache (as would be returned by cachem's
222219
#' `info()` method).
220+
#' @return [`list`] containing the info result as created by cachem
223221
#'
224222
#' @seealso [`set_cache`] to start a new cache (and general caching info),
225223
#' [`clear_cache`] to delete the cache and set a new one, and [`disable_cache`] to

R/covidcast.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#' turn a signal into a callable
22
#' @param signal the signal of interest
33
#' @param base_url the base url
4+
#' @keywords internal
45
parse_signal <- function(signal, base_url) {
56
class(signal) <- c("covidcast_data_signal", class(signal))
67
signal$key <- paste(signal$source, signal$signal, sep = ":")

cran-comments.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Calls in the following files call an API which if queried too frequently without a key would result in CRAN being temporarily locked out of running API calls (so a soft-API key problem)
2+
- [`epidatr/R/epidatacall.R`]
3+
- [`epidatr/R/request.R`]
4+
- [`epidatr/R/endpoints.R`]

inst/CITATION

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bibentry(
2+
"Misc",
3+
title = "Delphi Epidata API",
4+
author = "David C. Farrow, Logan C. Brooks, Aaron Rumack, Ryan J. Tibshirani, Roni Rosenfeld",
5+
year = 2015,
6+
url = "https://github.com/cmu-delphi/delphi-epidata"
7+
)

man/cache_info.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/clear_cache.Rd

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/disable_cache.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/epidatr-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/parse_signal.Rd

Lines changed: 23 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)