Covid-19-data: In theory using the NYTimes API, could I plot new CV-19 cases per day using ggplot in R?

Created on 15 Jul 2020  路  3Comments  路  Source: nytimes/covid-19-data

Thanks for this data New York Times, the thread title is my question, the example I present you with would look something like:

df %>% mutate(Orig_cases = ifelse(row_number()==1, sumCase, sumCase - lag(sumCase)))

 date cases cumCase Orig_cases
1  2020-01-01    88      88         88
2  2020-01-02    49     137         49
3  2020-01-03    14     151         14
question

All 3 comments

@Montana Yes, I'm not an R expert, but if that is subtracting the count on the previous day from the current day, that should give you the number of new new daily cases. Please read the README carefully, particularly the section on declining counts to understand the possible complications in interpereting the data that way.

I have done it in this open source dashboard via Shiny. The source code is available both on the dashboard as well as my repo. (And don't laugh too hard because I am actually using this data set as a tool for me to learn R 馃槈 )

Thank you both! I really appreciate it @cj2001 and @albertsun! Definitely would not laugh at you @cj2001 that's very cool.
@albertsun, thank you will reread about he declining counts to get a clarification and see what obstacles I might run into.

Was this page helpful?
0 / 5 - 0 ratings