Skip to content

Commit

Permalink
Update get_target_data.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Annabella-Hines authored Nov 27, 2024
1 parent 10df682 commit 56665c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions target-data/get_target_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ fetch_flu <- function(){
require(dplyr)
require(lubridate)
require(RSocrata)
require(stringr)

#read data from data.cdc.gov, filtering for when flu reporting became mandatory
health_data = RSocrata::read.socrata(url = "https://data.cdc.gov/resource/mpgq-jmmr.json") %>%
Expand All @@ -21,7 +20,7 @@ fetch_flu <- function(){
dplyr::rename("value" = "totalconfflunewadm", "date"="weekendingdate", "state"="jurisdiction") %>%
dplyr::mutate(date = as.Date(date),
value = as.numeric(value),
state = stringr::str_replace(state, "USA", "US"))
state = gsub(state, "USA", "US"))

#bind state population data
full_data = dplyr::left_join(recent_data, locations, by = join_by("state" == "abbreviation"))
Expand Down

0 comments on commit 56665c3

Please sign in to comment.