Skip to content

Commit 97ded60

Browse files
committed
going back to just using the API call
1 parent 9a8fc7c commit 97ded60

File tree

3 files changed

+34
-50
lines changed

3 files changed

+34
-50
lines changed

README.Rmd

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,6 @@ The documentation for the stable version is at
111111

112112
## Motivating example
113113

114-
To demonstrate using [`{epipredict}`](https://cmu-delphi.github.io/epipredict/) for forecasting, say we want to
115-
predict COVID-19 deaths per 100k people for each of a subset of states
116-
117-
```{r subset_geos}
118-
used_locations <- c("ca", "ma", "ny", "tx")
119-
```
120-
121-
on
122-
123-
```{r fc_date}
124-
forecast_date <- as.Date("2021-08-01")
125-
```
126114

127115
<details>
128116
<summary> Required packages </summary>
@@ -136,24 +124,28 @@ library(ggplot2)
136124
```
137125
</details>
138126

139-
```{r setting_cases_deaths}
140-
cases_deaths <- covid_case_death_rates |>
141-
filter(
142-
geo_value %in% used_locations,
143-
time_value <= "2021-12-31"
144-
)
145-
attr(cases_deaths, "metadata")$as_of <- as.Date("2022-01-01")
127+
To demonstrate using [`{epipredict}`](https://cmu-delphi.github.io/epipredict/) for forecasting, say we want to
128+
predict COVID-19 deaths per 100k people for each of a subset of states
129+
130+
```{r subset_geos}
131+
used_locations <- c("ca", "ma", "ny", "tx")
132+
```
133+
134+
on
135+
136+
```{r fc_date}
137+
forecast_date <- as.Date("2021-08-01")
146138
```
147139

148-
`covid_case_death_rates` is a subset of
149-
[Johns Hopkins Center for Systems Science and Engineering deaths data](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html) stored in [`{epidatasets}`](https://cmu-delphi.github.io/epidatasets/).
150-
Below the fold, we clean this dataset and demonstrate pulling it from the epidata API.
140+
We will be using a subset of
141+
[Johns Hopkins Center for Systems Science and Engineering deaths data](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html).
142+
Below the fold, we pull the dataset from the epidata API and clean it.
151143

152144
<details>
153145
<summary> Creating the dataset using `{epidatr}` and `{epiprocess}` </summary>
154146

155147
This section is intended to demonstrate some of the ubiquitous cleaning operations needed to be able to forecast.
156-
The dataset prepared here is also included ready-to-go in [`{epipredict}`](https://cmu-delphi.github.io/epipredict/) as `covid_case_death_rates`.
148+
A subset of this dataset prepared here is also included ready-to-go in [`{epipredict}`](https://cmu-delphi.github.io/epipredict/) as `covid_case_death_rates`.
157149

158150
First we pull both `jhu-csse` cases and deaths data from the
159151
[Delphi API](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html) using the

README.md

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@ is at <https://cmu-delphi.github.io/epipredict/dev>.
4545

4646
## Motivating example
4747

48-
To demonstrate using
49-
[`{epipredict}`](https://cmu-delphi.github.io/epipredict/) for
50-
forecasting, say we want to predict COVID-19 deaths per 100k people for
51-
each of a subset of states
52-
53-
``` r
54-
used_locations <- c("ca", "ma", "ny", "tx")
55-
```
56-
57-
on
58-
59-
``` r
60-
forecast_date <- as.Date("2021-08-01")
61-
```
62-
6348
<details>
6449
<summary>
6550
Required packages
@@ -75,28 +60,34 @@ library(ggplot2)
7560

7661
</details>
7762

63+
To demonstrate using
64+
[`{epipredict}`](https://cmu-delphi.github.io/epipredict/) for
65+
forecasting, say we want to predict COVID-19 deaths per 100k people for
66+
each of a subset of states
67+
7868
``` r
79-
cases_deaths <- covid_case_death_rates |>
80-
filter(geo_value %in% used_locations,
81-
time_value <= "2021-12-31")
82-
attr(cases_deaths, "metadata")$as_of <- as.Date("2022-01-01")
69+
used_locations <- c("ca", "ma", "ny", "tx")
70+
```
71+
72+
on
73+
74+
``` r
75+
forecast_date <- as.Date("2021-08-01")
8376
```
8477

85-
`covid_case_death_rates` is a subset of [Johns Hopkins Center for
86-
Systems Science and Engineering deaths
87-
data](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html)
88-
stored in [`{epidatasets}`](https://cmu-delphi.github.io/epidatasets/).
89-
Below the fold, we clean this dataset and demonstrate pulling it from
90-
the epidata API.
78+
We will be using a subset of [Johns Hopkins Center for Systems Science
79+
and Engineering deaths
80+
data](https://cmu-delphi.github.io/delphi-epidata/api/covidcast-signals/jhu-csse.html).
81+
Below the fold, we pull the dataset from the epidata API and clean it.
9182

9283
<details>
9384
<summary>
9485
Creating the dataset using `{epidatr}` and `{epiprocess}`
9586
</summary>
9687

9788
This section is intended to demonstrate some of the ubiquitous cleaning
98-
operations needed to be able to forecast. The dataset prepared here is
99-
also included ready-to-go in
89+
operations needed to be able to forecast. A subset of this dataset
90+
prepared here is also included ready-to-go in
10091
[`{epipredict}`](https://cmu-delphi.github.io/epipredict/) as
10192
`covid_case_death_rates`.
10293

vignettes/custom_epiworkflows.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ library(parsnip)
1717
library(workflows)
1818
library(recipes)
1919
library(epipredict)
20+
library(epiprocess)
2021
library(ggplot2)
2122
forecast_date <- as.Date("2021-08-01")
2223
used_locations <- c("ca", "ma", "ny", "tx")

0 commit comments

Comments
 (0)