-
Notifications
You must be signed in to change notification settings - Fork 5
Djm/pkgdown updates #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Djm/pkgdown updates #174
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9d9ee70
use delphi/CMU red, match `epipredict`
dajmcdon b28e56c
Make the readme an Rmd
dajmcdon e74682a
run styler, then rebuild README
dajmcdon 9688954
Update README.md
dshemetov 8f61786
Merge remote-tracking branch 'origin/ar/release-fixes' into djm/pkgdo…
dshemetov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ | |
| ^.venv$ | ||
| ^env$ | ||
| ^.env$ | ||
| ^README\.Rmd$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| --- | ||
| output: github_document | ||
| --- | ||
|
|
||
| <!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
|
||
| ```{r, include = FALSE} | ||
| knitr::opts_chunk$set( | ||
| collapse = TRUE, | ||
| comment = "#>", | ||
| fig.path = "man/figures/README-", | ||
| out.width = "100%" | ||
| ) | ||
| ggplot2::theme_set(ggplot2::theme_bw()) | ||
| ``` | ||
|
|
||
| # Delphi Epidata R client | ||
|
|
||
|
|
||
| <!-- badges: start --> | ||
| [![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url] | ||
| [](https://app.codecov.io/gh/dsweber2/epidatr) | ||
| <!-- badges: end --> | ||
|
|
||
|
|
||
|
|
||
| The [Delphi Epidata API](https://cmu-delphi.github.io/delphi-epidata/) 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)](https://www.cdc.gov/datastatistics/index.html) and [Google Trends](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/google-symptoms.html) and private partners such as [Facebook](https://delphi.cmu.edu/blog/2020/08/26/covid-19-symptom-surveys-through-facebook/) and [Change Healthcare](https://www.changehealthcare.com/). It is built and maintained by the Carnegie Mellon University [Delphi research group](https://delphi.cmu.edu/). | ||
|
|
||
| This package is designed to streamline the downloading and usage of data from the [Delphi Epidata | ||
| API](https://cmu-delphi.github.io/delphi-epidata/). It provides a simple R interface to the API, including functions for downloading data, parsing the results, and converting the data into a tidy format. The API stores a historical record of all data, including corrections and updates, which is particularly useful for accurately backtesting forecasting models. We also provide packages for downstream data processing ([epiprocess](https://github.com/cmu-delphi/epiprocess)) and modeling ([epipredict](https://github.com/cmu-delphi/epipredict)). | ||
|
|
||
| ## Usage | ||
|
|
||
| ```{r} | ||
| library(epidatr) | ||
| # Obtain the smoothed covid-like illness (CLI) signal from the | ||
| # Facebook survey as it was on April 10, 2021 for the US | ||
| epidata <- pub_covidcast( | ||
| source = "fb-survey", | ||
| signals = "smoothed_cli", | ||
| geo_type = "nation", | ||
| time_type = "day", | ||
| geo_values = "us", | ||
| time_values = epirange(20210101, 20210601), | ||
| as_of = "2021-06-01" | ||
| ) | ||
| epidata | ||
| ``` | ||
|
|
||
| ```{r fb-cli-signal} | ||
| # Plot this data | ||
| library(ggplot2) | ||
| ggplot(epidata, aes(x = time_value, y = value)) + | ||
| geom_line() + | ||
| labs( | ||
| title = "Smoothed CLI from Facebook Survey", | ||
| subtitle = "US, 2021", | ||
| x = "Date", | ||
| y = "CLI" | ||
| ) | ||
| ``` | ||
|
|
||
|
|
||
| ## Installation | ||
|
|
||
| Install from GitHub: | ||
|
|
||
| ```R | ||
| # Install the dev version using `pak` or `remotes` | ||
| pak::pkg_install("cmu-delphi/epidatr") | ||
| remotes::install_github("cmu-delphi/epidatr") | ||
| ``` | ||
|
|
||
| CRAN version coming soon. | ||
|
|
||
| ### API Keys | ||
|
|
||
| The Delphi API requires a (free) API key for full functionality. To generate | ||
| your key, register for a pseudo-anonymous account | ||
| [here](https://api.delphi.cmu.edu/epidata/admin/registration_form) and see more | ||
| discussion on the [general API | ||
| website](https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html). The | ||
| `epidatr` client will automatically look for this key in the R option | ||
| `delphi.epidata.key` or in the environment variable | ||
| `DELPHI_EPIDATA_KEY`. We recommend storing your key in `.Renviron` file, which R | ||
| will read by default. | ||
|
|
||
| Note that for the time being, the private endpoints (i.e. those prefixed with | ||
| `pvt`) will require a separate key that needs to be passed as an argument. | ||
|
|
||
| [mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg | ||
| [mit-url]: https://opensource.org/license/mit/ | ||
| [github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg | ||
| [github-actions-url]: https://github.com/cmu-delphi/epidatr/actions | ||
|
|
||
| ## Get updates | ||
|
|
||
| You should consider subscribing to the [API mailing list](https://lists.andrew.cmu.edu/mailman/listinfo/delphi-covidcast-api) to be notified of package updates, new data sources, corrections, and other updates. | ||
|
|
||
| ## For users of the `covidcast` R package | ||
|
|
||
| The `epidatr` package is a complete rewrite of the [`covidcast` package](https://cmu-delphi.github.io/covidcast/covidcastR/), with a focus on speed, reliability, and ease of use. The `covidcast` package is deprecated and will no longer be updated. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was hoping there was a way to generate the README from an rmd, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
devtools::document()orcheckautomatically rundevtools::render_readme()?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an action to do build it automatically, but I couldn't find it. I know I've seen it used elsewhere though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I know of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a handy Makefile with some chore commands, I guess in absence of something R-built-in, we use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yea, looks like they noped out of doing it auto
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh in a comment there, found
usethis::use_readme_rmd(), but it just builds the skeleton README.rmd and writes a git pre-commit hook