Skip to content
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

Fix/missing rmarkdown #12

Merged
merged 5 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ Imports:
Suggests:
httptest,
knitr,
rmarkdown,
testthat
BugReports: https://github.com/GLOrozcoM/epair/issues
URL: https://github.com/GLOrozcoM/epair
VignetteBuilder:
knitr
SystemRequirements: pandoc
10 changes: 10 additions & 0 deletions vignettes/making-your-first-call.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ library(epair)
library(httr)
library(rvest)
library(jsonlite)

aqs_email = Sys.getenv("API_EMAIL")
aqs_api_key = Sys.getenv("API_KEY")
Sys.setenv('aqs_email' = aqs_email)
Sys.setenv('aqs_api_key' = aqs_api_key)
```

At the outset, we may not know exactly what we want from the API. We can start by taking a look at the `services` object included with the package. The `services` object is an R list that contains information about each service offered by the EPA API and how to use it.
Expand Down Expand Up @@ -65,6 +70,11 @@ options(epa_authentication = epa.authentication)
```

```{r echo = FALSE}
aqs_email = Sys.getenv("API_EMAIL")
aqs_api_key = Sys.getenv("API_KEY")
Sys.setenv('aqs_email' = aqs_email)
Sys.setenv('aqs_api_key' = aqs_api_key)

epa.authentication <- create.authentication(Sys.getenv('aqs_email'), Sys.getenv('aqs_api_key'))
options(epa_authentication = epa.authentication)
```
Expand Down
10 changes: 10 additions & 0 deletions vignettes/setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@ library(epair)
library(rvest)
library(httr)
library(jsonlite)

aqs_email = Sys.getenv("API_EMAIL")
aqs_api_key = Sys.getenv("API_KEY")
Sys.setenv('aqs_email' = aqs_email)
Sys.setenv('aqs_api_key' = aqs_api_key)
```

To use the API, we need to have a valid email and API key with the EPA website. Getting an API key is easy, and can be done following the instructions [here](https://aqs.epa.gov/aqsweb/documents/data_api.html#signup).
Once we have the email and key, we can easily set these up to be in our requests.

```{r echo = FALSE}
aqs_email = Sys.getenv("API_EMAIL")
aqs_api_key = Sys.getenv("API_KEY")
Sys.setenv('aqs_email' = aqs_email)
Sys.setenv('aqs_api_key' = aqs_api_key)

epa.authentication <- create.authentication(Sys.getenv('aqs_email'), Sys.getenv('aqs_api_key'))
options( epa_authentication = epa.authentication )
```
Expand Down