Skip to content

Commit 12c1811

Browse files
authored
Merge pull request #135 from cmu-delphi/ds/docs-landing
feat: clean README, move changelog to NEWS
2 parents 739935f + 6c81e43 commit 12c1811

13 files changed

+483
-501
lines changed

.bumpversion.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[bumpversion]
2-
current_version = 0.7.0
2+
current_version = 0.7.1
33
commit = False
44
tag = False
55

66
[bumpversion:file:DESCRIPTION]
7-
[bumpversion:file:R/constants.R]
87

8+
[bumpversion:file:R/constants.R]

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: epidatr
22
Type: Package
33
Title: Client for Delphi's Epidata API
4-
Version: 0.7.0
4+
Version: 0.7.1
55
Authors@R: as.person(c(
66
"Jacob Bien <[email protected]> [aut]",
77
"Logan Brooks <[email protected]> [aut]",

NEWS.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
# epidatr 1.0.0
1+
# epidatr 0.7.1
2+
3+
- Update README.md for better onboarding.
4+
- Consolidate the vignettes into one. Clean up the code, do not eval most examples.
5+
6+
# epidatr 0.7.0
7+
8+
- Remove temporary code for API key transition.
9+
- Add `timeout_seconds` and `return_empty` arguments to `fetch()`.
10+
11+
# epidatr 0.6.0
12+
13+
- The `fetch_{tbl,classic,df,json,csv}` functions have been replaced by the
14+
`fetch()` function, which almost always returns a tibble, except when used with
15+
a limited number of older endpoints (such as `delphi()` and `meta()`), where it
16+
will output a nested list structure.
17+
18+
# epidatr 0.5.0
19+
20+
- The package that this installs is being renamed from `delphi.epidata` to
21+
`epidatr`. To migrate, run the installation command above, followed by
22+
`remove.packages("delphi.epidata")`, and adjust all references to the package
23+
name accordingly.

R/constants.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version <- "0.7.0"
1+
version <- "0.7.1"
22
http_headers <- httr::add_headers("User-Agent" = paste0("epidatr/", version), "Accept-Encoding" = "gzip")
33
global_base_url <- "https://api.delphi.cmu.edu/epidata/"

README.md

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,60 @@
1-
# delphi Epidata R client
1+
# Delphi Epidata R client
22

33
[![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url]
44
[![codecov](https://codecov.io/gh/dsweber2/epidatr/branch/dev/graph/badge.svg?token=jVHL9eHZNZ)](https://codecov.io/gh/dsweber2/epidatr)
55

6-
## Documentation
6+
This package provides an R client for the [Delphi Epidata
7+
API](https://cmu-delphi.github.io/delphi-epidata/).
78

8-
- [Package website](https://cmu-delphi.github.io/epidatr/)
9-
10-
## Install
11-
12-
Install latest version using [`remotes`](https://cran.r-project.org/package=remotes) package
9+
## Usage
1310

14-
```R
15-
remotes::install_github("cmu-delphi/epidatr")
11+
```r
12+
library(epidatr)
13+
epicall <- covidcast("fb-survey", "smoothed_cli", "nation", "day", "us", epirange(20210405, 20210410))
14+
epicall %>% fetch()
1615
```
1716

18-
Note (2023-05-23): since version 0.6.0, the `fetch_{tbl,classic,df,json,csv}`
19-
functions have been replaced by the `fetch()` function, which almost always
20-
returns a tibble, except when used with a limited number of older endpoints
21-
(such as `delphi()` and `meta()`), where it will output a nested list structure.
22-
If you encounter an error like
23-
24-
```{r}
25-
Error in fetch_tbl(.) : could not find function "fetch_tbl"
2617
```
27-
28-
please update to use `fetch()` instead. If instead you encounter
29-
30-
```{r}
31-
Error in fetch(.) : could not find function "fetch"
18+
# A tibble: 6 × 15
19+
geo_value signal source geo_type time_type time_value
20+
<chr> <chr> <chr> <fct> <fct> <date>
21+
1 us smoothed_cli fb-surv… nation day 2021-04-05
22+
2 us smoothed_cli fb-surv… nation day 2021-04-06
23+
3 us smoothed_cli fb-surv… nation day 2021-04-07
24+
4 us smoothed_cli fb-surv… nation day 2021-04-08
25+
5 us smoothed_cli fb-surv… nation day 2021-04-09
26+
6 us smoothed_cli fb-surv… nation day 2021-04-10
27+
# ℹ 9 more variables: direction <dbl>, issue <date>,
28+
# lag <int>, missing_value <int>, missing_stderr <int>,
29+
# missing_sample_size <int>, value <dbl>, stderr <dbl>,
30+
# sample_size <dbl>
3231
```
3332

34-
please update to the newest `epidatr`.
33+
## Installation
3534

36-
Note (2022-08-02): the package that this installs is being renamed from
37-
`delphi.epidata` to `epidatr`. To migrate, run the installation command above,
38-
followed by `remove.packages("delphi.epidata")`, and adjust all references to
39-
the package name accordingly. For a short-term patch, a snapshot of the package
40-
can be still be installed with the old name by specifying
41-
`ref="delphi.epidata-before-rename"`.
35+
Install the latest version using [`pak`](https://cran.r-project.org/package=pak)
36+
package
4237

43-
## Usage
38+
```R
39+
pak::pkg_install("cmu-delphi/epidatr")
40+
```
4441

45-
TODO
42+
CRAN version coming soon.
4643

47-
## API Keys
44+
### API Keys
4845

49-
The Delphi API will soon require a (free) API key for full functionality.
50-
The `epidatr` client will automatically look for this key in the R option `delphi.epidata.key`
51-
and then from the environment variable `DELPHI_EPIDATA_KEY`.
52-
We recommend storing your key in `.Renviron` file, which R will read by default.
53-
You can do this with `usethis::edit_r_environ()` and there enter `DELPHI_EPIDATA_KEY=<your-key>`.
54-
An alternative is [the dotenv package](https://github.com/gaborcsardi/dotenv/).
55-
To generate your key, register for a pseudo-anonymous account
56-
[here](https://api.delphi.cmu.edu/epidata/admin/registration_form), and see more discussion on
57-
the [general API website](https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html).
46+
The Delphi API requires a (free) API key for full functionality. To generate
47+
your key, register for a pseudo-anonymous account
48+
[here](https://api.delphi.cmu.edu/epidata/admin/registration_form) and see more
49+
discussion on the [general API
50+
website](https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html). The
51+
`epidatr` client will automatically look for this key in the R option
52+
`delphi.epidata.key` and then from the environment variable
53+
`DELPHI_EPIDATA_KEY`. We recommend storing your key in `.Renviron` file, which R
54+
will read by default.
5855

59-
Note that for the time being, the private endpoints (i.e. those prefixed with `pvt`) will require
60-
a separate key that needs to be passed as an argument.
56+
Note that for the time being, the private endpoints (i.e. those prefixed with
57+
`pvt`) will require a separate key that needs to be passed as an argument.
6158

6259
## Development Environment
6360

@@ -79,15 +76,13 @@ devtools::check() # check package for errors
7976
The release consists of multiple steps which can be all done via the GitHub website:
8077

8178
1. Go to [create_release GitHub Action](https://github.com/cmu-delphi/epidatr/actions/workflows/create_release.yml) and click the `Run workflow` button. Enter the next version number or one of the magic keywords (patch, minor, major) and hit the green `Run workflow` button.
82-
1. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatr/pulls)
83-
1. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
84-
1. Once approved and merged, another GitHub action job starts which automatically will
79+
2. The action will prepare a new release and will end up with a new [Pull Request](https://github.com/cmu-delphi/epidatr/pulls)
80+
3. Let the code owner review the PR and its changes and let the CI check whether everything builds successfully
81+
4. Once approved and merged, another GitHub action job starts which automatically will
8582
1. create a git tag
86-
1. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch
87-
1. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes
88-
1. Done
89-
90-
TODO release to CRAN
83+
2. create another [Pull Request](https://github.com/cmu-delphi/epidatr/pulls) to merge the changes back to the `dev` branch
84+
3. create a [GitHub release](https://github.com/cmu-delphi/epidatr/releases) with automatically derived release notes
85+
5. Release to CRAN
9186

9287
[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
9388
[mit-url]: https://opensource.org/licenses/MIT

man/fetch_classic.Rd

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

man/fetch_tbl.Rd

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

man/format_item.Rd

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

man/format_list.Rd

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

man/request_url.Rd

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

vignettes/covidcast.Rmd

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)