Skip to content

Commit 5e8ba56

Browse files
committed
note as_of in data docs; use as_of in vignette data fetch code
1 parent f135010 commit 5e8ba56

10 files changed

+44
-34
lines changed

man/cases_deaths_subset.Rd

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

man/covid_incidence_county_subset.Rd

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

man/covid_incidence_outliers.Rd

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

man/jhu_confirmed_cumulative_num.Rd

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

vignettes/aggregation.Rmd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ library(covidcast)
2020
library(epiprocess)
2121
library(dplyr)
2222
23-
x <- epiprocess::covid_incidence_county_subset
23+
x <- covid_incidence_county_subset
2424
```
2525

2626
The data can also be fetched from the Delphi API with the following query:
2727
```{r, message = FALSE, eval = FALSE, warning = FALSE}
28+
d <- as.Date("2024-03-20")
29+
2830
# Use covidcast::county_census to get the county and state names
2931
y <- covidcast::county_census %>%
3032
filter(STNAME %in% c("Massachusetts", "Vermont"), STNAME != CTYNAME) %>%
@@ -38,10 +40,11 @@ x <- pub_covidcast(
3840
time_type = "day",
3941
geo_values = paste(y$geo_value, collapse = ","),
4042
time_values = epirange(20200601, 20211231),
43+
as_of = d
4144
) %>%
4245
select(geo_value, time_value, cases = value) %>%
4346
full_join(y, by = "geo_value") %>%
44-
as_epi_df()
47+
as_epi_df(as_of = d)
4548
```
4649

4750
The data contains 16,212 rows and 5 columns.

vignettes/correlation.Rmd

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,40 @@ library(dplyr)
2323

2424
The data is included in this package (via the [`epidatasets` package](https://cmu-delphi.github.io/epidatasets/)) and can be loaded with:
2525
```{r}
26-
x <- cases_deaths_subset %>%
27-
select(geo_value, time_value, case_rate = case_rate_7d_av, death_rate = death_rate_7d_av) %>%
28-
arrange(geo_value, time_value) %>%
29-
as_epi_df()
26+
x <- covid_case_death_rates %>%
27+
select(geo_value, time_value, case_rate, death_rate) %>%
28+
arrange(geo_value, time_value)
3029
```
3130

3231
The data can also be fetched from the Delphi API with the following query:
3332
```{r, eval = FALSE}
33+
d <- as.Date("2024-03-20")
34+
3435
x <- pub_covidcast(
3536
source = "jhu-csse",
3637
signals = "confirmed_7dav_incidence_prop",
37-
geo_type = "state",
3838
time_type = "day",
39-
geo_values = "*",
39+
geo_type = "state",
4040
time_values = epirange(20200301, 20211231),
41+
geo_values = "*",
42+
as_of = d
4143
) %>%
4244
select(geo_value, time_value, case_rate = value)
4345
4446
y <- pub_covidcast(
4547
source = "jhu-csse",
4648
signals = "deaths_7dav_incidence_prop",
47-
geo_type = "state",
4849
time_type = "day",
49-
geo_values = "*",
50+
geo_type = "state",
5051
time_values = epirange(20200301, 20211231),
52+
geo_values = "*",
53+
as_of = d
5154
) %>%
5255
select(geo_value, time_value, death_rate = value)
5356
5457
x <- x %>%
5558
full_join(y, by = c("geo_value", "time_value")) %>%
56-
as_epi_df()
59+
as_epi_df(as_of = d)
5760
```
5861

5962
## Correlations grouped by time

vignettes/epiprocess.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ library(dplyr)
110110
library(tidyr)
111111
library(withr)
112112
113-
cases <- epiprocess::jhu_confirmed_cumulative_num
113+
cases <- jhu_confirmed_cumulative_num
114114
115115
colnames(cases)
116116
```

vignettes/growth_rate.Rmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,27 @@ library(tidyr)
2424
The data is included in this package (via the [`epidatasets` package](https://cmu-delphi.github.io/epidatasets/)) and can be loaded with:
2525

2626
```{r}
27-
x <- epiprocess::cases_deaths_subset %>%
27+
x <- cases_deaths_subset %>%
2828
select(geo_value, time_value, cases = cases_7d_av) %>%
2929
filter(geo_value %in% c("pa", "ga") & time_value >= "2020-06-01") %>%
30-
arrange(geo_value, time_value) %>%
31-
as_epi_df()
30+
arrange(geo_value, time_value)
3231
```
3332

3433
The data can also be fetched from the Delphi API with the following query:
3534
```{r, message = FALSE, eval = FALSE}
35+
d <- as.Date("2024-03-20")
3636
x <- pub_covidcast(
3737
source = "jhu-csse",
3838
signals = "confirmed_7dav_incidence_num",
3939
geo_type = "state",
4040
time_type = "day",
4141
geo_values = "ga,pa",
4242
time_values = epirange(20200601, 20211231),
43+
as_of = d
4344
) %>%
4445
select(geo_value, time_value, cases = value) %>%
4546
arrange(geo_value, time_value) %>%
46-
as_epi_df()
47+
as_epi_df(as_of = d)
4748
```
4849

4950
The data has 1,158 rows and 3 columns.

vignettes/outliers.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library(epiprocess)
2222
library(dplyr)
2323
library(tidyr)
2424
25-
x <- epiprocess::covid_incidence_outliers
25+
x <- covid_incidence_outliers
2626
```
2727

2828
```{r, fig.width = 8, fig.height = 7, warning=FALSE,message=FALSE}

vignettes/slide.Rmd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,26 @@ library(dplyr)
3737
The data is included in this package (via the [`epidatasets` package](https://cmu-delphi.github.io/epidatasets/)) and can be loaded with:
3838

3939
```{r}
40-
x <- epiprocess::cases_deaths_subset %>%
40+
x <- cases_deaths_subset %>%
4141
select(geo_value, time_value, cases) %>%
42-
arrange(geo_value, time_value) %>%
43-
as_epi_df()
42+
arrange(geo_value, time_value)
4443
```
4544

4645
The data can also be fetched from the Delphi API with the following query:
4746
```{r, message = FALSE, eval = FALSE}
47+
d <- as.Date("2024-03-20")
4848
x <- pub_covidcast(
4949
source = "jhu-csse",
5050
signals = "confirmed_incidence_num",
5151
geo_type = "state",
5252
time_type = "day",
5353
geo_values = "ca,fl,ny,tx,ga,pa",
5454
time_values = epirange(20200301, 20211231),
55+
as_of = d
5556
) %>%
5657
select(geo_value, time_value, cases = value) %>%
5758
arrange(geo_value, time_value) %>%
58-
as_epi_df()
59+
as_epi_df(as_of = d)
5960
```
6061

6162
The data has 2,684 rows and 3 columns.

0 commit comments

Comments
 (0)