Skip to content

Commit 8dc4257

Browse files
authored
Merge pull request #172 from cmu-delphi/cranChecklist
Cran checklist
2 parents 7c579ac + 1d4c769 commit 8dc4257

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+295
-150
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# update the documentation web site on pushes to `dev` branch.
66
on:
77
push:
8-
branches: [main, master, dev]
8+
branches: [main]
99
pull_request:
10-
branches: [main, master, dev]
10+
branches: [main]
1111
release:
1212
types: [published]
1313
workflow_dispatch:

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Authors@R:
1717
)
1818
URL: https://cmu-delphi.github.io/epidatr/, https://github.com/cmu-delphi/epidatr
1919
BugReports: https://github.com/cmu-delphi/epidatr/issues
20-
Description: R Client for Delphi's 'Epidata' API. Tools for fetching data in various forms.
20+
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.
2121
Depends: R (>= 3.5.0)
2222
License: MIT + file LICENSE
2323
Encoding: UTF-8

R/auth.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#' Get the API key
1+
#' Getting the API key
22
#'
3+
#' @description
34
#' Get the API key from the environment variable `DELPHI_EPIDATA_KEY` or
45
#' `getOption("delphi.epidata.key")`.
56
#'
6-
#' @return The API key
7+
#' @return The API key as a string or "".
78
#'
89
#' @export
910
get_auth_key <- function() {

R/avail_endpoints.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
#' List all available endpoints
1+
#' List all available endpoints.
22
#'
3-
#' @return A [`tibble::tibble`] with 2 columns. `Endpoint` contains the function
4-
#' for accessing the Delphi Epidata API endpoint along with a `Description`.
3+
#' @description
4+
#' A function that prints a tibble with two columns: `Endpoint` contains the
5+
#' function for accessing the Delphi Epidata API endpoint along with a
6+
#' `Description`.
7+
#'
8+
#' @return A [`tibble::tibble`].
59
#' @export
610
#' @importFrom utils help.search
711
#'
812
#' @examples
9-
#' endps <- avail_endpoints()
10-
#' print(endps, n = nrow(endps))
13+
#' avail_endpoints()
1114
avail_endpoints <- function() {
1215
h <- help.search("endpoint",
1316
package = "epidatr", fields = "concept",

R/cache.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,11 @@ disable_cache <- function() {
216216
}
217217

218218
#' Describe current cache
219+
#'
219220
#' @description
220221
#' Print out the information about the cache (as would be returned by cachem's
221-
#' `info()` method)
222+
#' `info()` method).
223+
#'
222224
#' @seealso [`set_cache`] to start a new cache (and general caching info),
223225
#' [`clear_cache`] to delete the cache and set a new one, and [`disable_cache`] to
224226
#' disable without deleting
@@ -234,7 +236,7 @@ cache_info <- function() {
234236
#' Dispatch caching
235237
#'
236238
#' @description
237-
#' the guts of caching, its interposed between fetch and the specific fetch
239+
#' The guts of caching, its interposed between fetch and the specific fetch
238240
#' methods. Internal method only.
239241
#'
240242
#' @param call the `epidata_call` object

R/covidcast.R

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,39 @@ print.covidcast_data_source <- function(x, ...) {
9696
}
9797

9898
#' Creates the COVIDcast Epidata autocomplete helper
99-
#'
99+
#' @description
100100
#' Creates a helper object that can use auto-complete to help find COVIDcast
101-
#' sources and signals.
101+
#' sources and signals. The [COVIDcast
102+
#' endpoint](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html) of
103+
#' the Epidata API contains many separate data sources and signals. It can be
104+
#' difficult to find the name of the signal you're looking for, so you can use
105+
#' `covidcast_epidata` to get help with finding sources and functions without
106+
#' leaving R.
107+
#'
108+
#' The `covidcast_epidata()` function fetches a list of all signals, and returns
109+
#' an object containing fields for every signal:
110+
#' ```{r}
111+
#' epidata <- covidcast_epidata()
112+
#' epidata$signals
113+
#' ```
114+
#'
115+
#' If you use an editor that supports tab completion, such as RStudio, type
116+
#' `epidata$signals$` and wait for the tab completion popup. You will be able
117+
#' to type the name of signals and have the autocomplete feature select them
118+
#' from the list for you. Note that some signal names have dashes in them, so
119+
#' to access them we rely on the backtick operator:
120+
#'
121+
#' ```{r}
122+
#' epidata$signals$`fb-survey:smoothed_cli`
123+
#' ```
124+
#'
125+
#' These objects can be used directly to fetch data, without requiring us to use
126+
#' the `covidcast()` function. Simply use the `$call` attribute of the object:
102127
#'
128+
#' ```{r}
129+
#' epidata$signals$`fb-survey:smoothed_cli`$call("state", "pa",
130+
#' epirange(20210405, 20210410))
131+
#' ```
103132
#' @param base_url optional alternative API base url
104133
#' @param timeout_seconds the maximum amount of time to wait for a response
105134
#' @importFrom httr stop_for_status content http_type

0 commit comments

Comments
 (0)