From d06ef22b079fc2adac69dc50a5dcb49cb78d735b Mon Sep 17 00:00:00 2001 From: mmlawrence Date: Sat, 6 Nov 2021 21:53:17 -0400 Subject: [PATCH 1/5] updating rmarkdown dependencies --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 60adcef..23595b7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,6 +32,7 @@ Imports: Suggests: httptest, knitr, + rmarkdown, testthat BugReports: https://github.com/GLOrozcoM/epair/issues URL: https://github.com/GLOrozcoM/epair From 4a22267512b3da8f8ae9522a5db7b5f9eb7f958f Mon Sep 17 00:00:00 2001 From: mmlawrence Date: Sat, 6 Nov 2021 22:08:06 -0400 Subject: [PATCH 2/5] add pandoc requirement --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 23595b7..96ba91d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -38,3 +38,4 @@ BugReports: https://github.com/GLOrozcoM/epair/issues URL: https://github.com/GLOrozcoM/epair VignetteBuilder: knitr +SystemRequirements: pandoc From 610e65ad14c7fd911f9089fdad0a2dbb9ecac25c Mon Sep 17 00:00:00 2001 From: mmlawrence <62000237+mmlawrence@users.noreply.github.com> Date: Sat, 6 Nov 2021 22:41:22 -0400 Subject: [PATCH 3/5] pandoc setup required --- .github/workflows/R-CMD-check.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 7104168..7f941ab 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -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: | From 43eb9a5c4ed597ff18d81df5db8ad385d6fc4988 Mon Sep 17 00:00:00 2001 From: mmlawrence Date: Sat, 6 Nov 2021 23:14:24 -0400 Subject: [PATCH 4/5] adding call to hidden keys --- vignettes/making-your-first-call.Rmd | 5 +++++ vignettes/setup.Rmd | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/vignettes/making-your-first-call.Rmd b/vignettes/making-your-first-call.Rmd index 833887d..222898f 100644 --- a/vignettes/making-your-first-call.Rmd +++ b/vignettes/making-your-first-call.Rmd @@ -65,6 +65,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) ``` diff --git a/vignettes/setup.Rmd b/vignettes/setup.Rmd index 39de2c5..6556338 100644 --- a/vignettes/setup.Rmd +++ b/vignettes/setup.Rmd @@ -28,6 +28,11 @@ To use the API, we need to have a valid email and API key with the EPA website. 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 ) ``` From 78edd73ea9f0cf4ceda667c2880548a19625677f Mon Sep 17 00:00:00 2001 From: mmlawrence Date: Thu, 11 Nov 2021 20:23:17 -0500 Subject: [PATCH 5/5] adding live api email and password global vars --- vignettes/making-your-first-call.Rmd | 5 +++++ vignettes/setup.Rmd | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/vignettes/making-your-first-call.Rmd b/vignettes/making-your-first-call.Rmd index 222898f..bd5c859 100644 --- a/vignettes/making-your-first-call.Rmd +++ b/vignettes/making-your-first-call.Rmd @@ -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. diff --git a/vignettes/setup.Rmd b/vignettes/setup.Rmd index 6556338..0dbf89f 100644 --- a/vignettes/setup.Rmd +++ b/vignettes/setup.Rmd @@ -22,6 +22,11 @@ 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).