Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

South Africa new reported cases around higher than Our World In Data/WHO #474

Open
bquilty25 opened this issue Jan 3, 2024 · 4 comments

Comments

@bquilty25
Copy link

I have been using this package to plot the waves in South Africa from 2020-2023. When updating the figure I noticed that the number of new cases reported each day was substantially higher than it was previously, and compared to data downloaded from Our World In Data:

sa_cases

Copy link

github-actions bot commented Jan 3, 2024

Thanks for opening an issue! We'll try and get back to you shortly. If you've identified an issue and would like to fix it please see our contribution guidelines.

@seabbs
Copy link
Contributor

seabbs commented Jan 3, 2024

Thanks Billy. As you may have noticed covidregionaldata hasn't had a patch in a fair while so issues may have crept in. Can you post a reprex of what you are doing to get data? In particular what data source are you using for SA?

@bquilty25
Copy link
Author

bquilty25 commented Jan 3, 2024

Hey Sam,

It was with default arguments, so I guess WHO (see below). I haven't tried downloading from source separately yet (https://covid19.who.int/WHO-COVID-19-global-data.csv), but just wanted to flag.

sa_dat <- get_national_data(countries = "South Africa") 

sa_plot <- read_csv("data/owid-covid-data.csv")%>%
  filter(iso_code == "ZAF") %>%
  mutate(date = as.Date(date)) %>%
  filter(date <= as.Date("2023-01-01")) %>% 
  ggplot(aes(x = date, y = new_cases))+
  geom_col(alpha = 0.75, aes(fill = "OWID/WHO"))+
  geom_point(data = sa_dat %>% 
               mutate(date = as.Date(date)) %>%
               filter(date <= as.Date("2023-01-01")),
             aes(x = date,y = cases_new, fill = "covidregionaldata"))+
  labs(x = "",y = "Daily reported cases")+
  scale_fill_brewer(palette = "Set2")

ggsave("results/sa_cases.png", width=200, height=100, units="mm", dpi=600, bg="white")

@bquilty25
Copy link
Author

bquilty25 commented Jan 3, 2024

Ah looks like it may be an issue with the source data:

sa_dat <- get_national_data(countries = "South Africa")

sa_plot <- read_csv("data/owid-covid-data.csv") %>%
  filter(iso_code == "ZAF") %>%
  mutate(date = as.Date(date)) %>%
  filter(date <= as.Date("2023-01-01")) %>%
  ggplot(aes(x = date, y = new_cases)) +
  geom_col(alpha = 0.75, aes(colour = "OWID/WHO")) +
  geom_point(
    data = sa_dat %>%
      mutate(date = as.Date(date)) %>%
      filter(date <= as.Date("2023-01-01")),
    aes(x = date, y = cases_new, colour = "covidregionaldata")
  ) +
  geom_line(
    data = read_csv("https://covid19.who.int/WHO-COVID-19-global-data.csv") %>%
      filter(Country == "South Africa") %>%
      filter(Date_reported <= as.Date("2023-01-01")),
    aes(x = Date_reported, y = New_cases, colour = "WHO")
  ) +
  labs(x = "", y = "Daily reported cases") +
  scale_colour_brewer(palette = "Set2")

sa_cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants