Skip to content

Commit c86ac10

Browse files
committed
refactor: remove Suggests dependence on covidcast
* just download the state data file, don't import covidcast * covidcast depends on sf which is tough to install
1 parent 3892a53 commit c86ac10

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Imports:
4949
vctrs,
5050
workflows (>= 1.0.0)
5151
Suggests:
52-
covidcast,
5352
data.table,
5453
epidatr (>= 1.0.0),
5554
fs,

data-raw/case_death_rate_subset.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
library(tidyverse)
2-
library(covidcast)
32
library(epidatr)
43
library(epiprocess)
54

6-
x <- covidcast(
5+
x <- pub_covidcast(
76
data_source = "jhu-csse",
87
signals = "confirmed_7dav_incidence_prop",
98
time_type = "day",
109
geo_type = "state",
1110
time_values = epirange(20201231, 20211231),
1211
geo_values = "*"
1312
) %>%
14-
fetch() %>%
1513
select(geo_value, time_value, case_rate = value)
1614

17-
y <- covidcast(
15+
y <- pub_covidcast(
1816
data_source = "jhu-csse",
1917
signals = "deaths_7dav_incidence_prop",
2018
time_type = "day",
2119
geo_type = "state",
2220
time_values = epirange(20201231, 20211231),
2321
geo_values = "*"
2422
) %>%
25-
fetch() %>%
2623
select(geo_value, time_value, death_rate = value)
2724

2825
case_death_rate_subset <- x %>%

data-raw/state_census.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
library(dplyr)
22
library(tidyr)
33

4-
state_census <- covidcast::state_census %>%
4+
remote_file <- "https://github.com/cmu-delphi/covidcast/raw/refs/heads/main/R-packages/covidcast/data/state_census.rda"
5+
download.file(remote_file, "state_census.rda")
6+
load("state_census.rda")
7+
state_census <- state_census %>%
58
select(STATE, NAME, POPESTIMATE2019, ABBR) %>%
69
rename(abbr = ABBR, name = NAME, pop = POPESTIMATE2019, fips = STATE) %>%
710
mutate(abbr = tolower(abbr)) %>%
811
as_tibble()
9-
12+
file.remove("state_census.rda")
1013

1114
usethis::use_data(state_census, overwrite = TRUE)

0 commit comments

Comments
 (0)