Skip to content

Commit

Permalink
Merge pull request #402 from cmu-delphi/ds/file
Browse files Browse the repository at this point in the history
refactor: remove Suggests dependence on covidcast
  • Loading branch information
dajmcdon authored Oct 16, 2024
2 parents a415100 + 57df54c commit e53af97
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Imports:
vctrs,
workflows (>= 1.0.0)
Suggests:
covidcast,
data.table,
epidatr (>= 1.0.0),
fs,
Expand All @@ -61,6 +60,7 @@ Suggests:
quantreg,
ranger,
RcppRoll,
readr,
rmarkdown,
smoothqr,
testthat (>= 3.0.0),
Expand Down
7 changes: 2 additions & 5 deletions data-raw/case_death_rate_subset.R
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
library(tidyverse)
library(covidcast)
library(epidatr)
library(epiprocess)

x <- covidcast(
x <- pub_covidcast(
data_source = "jhu-csse",
signals = "confirmed_7dav_incidence_prop",
time_type = "day",
geo_type = "state",
time_values = epirange(20201231, 20211231),
geo_values = "*"
) %>%
fetch() %>%
select(geo_value, time_value, case_rate = value)

y <- covidcast(
y <- pub_covidcast(
data_source = "jhu-csse",
signals = "deaths_7dav_incidence_prop",
time_type = "day",
geo_type = "state",
time_values = epirange(20201231, 20211231),
geo_values = "*"
) %>%
fetch() %>%
select(geo_value, time_value, death_rate = value)

case_death_rate_subset <- x %>%
Expand Down
3 changes: 1 addition & 2 deletions data-raw/state_census.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
library(dplyr)
library(tidyr)

state_census <- covidcast::state_census %>%
state_census <- readr::read_csv("https://github.com/cmu-delphi/covidcast/raw/c89e4d295550ba1540d64d2cc991badf63ad04e5/Python-packages/covidcast-py/covidcast/geo_mappings/state_census.csv") %>% # nolint: line_length_linter
select(STATE, NAME, POPESTIMATE2019, ABBR) %>%
rename(abbr = ABBR, name = NAME, pop = POPESTIMATE2019, fips = STATE) %>%
mutate(abbr = tolower(abbr)) %>%
as_tibble()


usethis::use_data(state_census, overwrite = TRUE)

0 comments on commit e53af97

Please sign in to comment.